ArcObjects Library Reference (Carto)  

IUniqueValueRenderer.AddValue Method

Adds a value and corresponding symbol to the list. For multivariate cases, the specified value is a delimitted list of individual values.

[Visual Basic .NET]
Public Sub AddValue ( _
    ByVal Value As String, _
    ByVal Heading As String, _
    ByVal Symbol As ISymbol _
)
[C#]
public void AddValue (
    string Value,
    string Heading,
    ISymbol Symbol
);
[C++]
HRESULT AddValue(
  BSTR Value,
  BSTR Heading,
  ISymbol* Symbol
);
[C++]

Parameters

Value [in]   Value is a parameter of type BSTR Heading   Heading is a parameter of type BSTR Symbol [in]

  Symbol is a parameter of type ISymbol

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Adds a value and symbol to the list of unique values.

Remarks

After setting FieldCount and setting at least one Field, use this method to add a unique value and corresponding symbol to the renderer. You can later retrieve and/or change the symbol for particular value using the Symbol property.

If you pass a Value that already exists in the renderer, then the existing symbol for the Value will be replaced by the object passed as the Symbol parameter.

If FieldCount > 1 then the Value you pass should be a list of values, one for each field, separated by the FieldDelimitter. By default this is a comma.

To add a value to the renderer, and have that value be drawn with the same symbol as another existing value or values, use AddReferenceValue instead of AddValue. When more than one value is drawn with the same symbol, the values are said to be grouped.

Null Values

At ArcGIS versions 8.2 and later, special behavior was added to the UniqueValueRenderer to handle Null values. If you add the special value "<Null>" to your renderer and your database supports Nulls, then features where Field = Null will be drawn with the "<Null>" symbol. 

The "<Null>" symbol may also be used in table join situations. With joins that keep unmatched records, ArcMap inserts artificial Nulls into the virtual join table. Features with these values will also be drawn with the "<Null>" UniqueValueRenderer symbol.
International users working with a localized version of ArcGIS should add the localized version of the string "<Null>" to get the special behaviors described above.
See the associated Example to see how to scan a feature class for unique values and then add them to a UniqueValueRenderer.

See Also

IUniqueValueRenderer Interface