ArcGIS Explorer Component Help |
Subtypes..::.SubtypeColumnName Property |
Subtypes Class Example See Also |
The name of the column which has been subtyped.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public string SubtypeColumnName { get; } |
Visual Basic (Declaration) |
---|
Public ReadOnly Property SubtypeColumnName As String |
Field Value
The name of the subtyped column.Examples
The code below demonstrates how to access the subtypes in a Table. The Table.IsSubtyped property is used
to check that the Table is subtyped and the ColumnCollection.Subtypes property returns the Subtypes object.
The name of the subtyped column is printed using the SubtypeColumnName property.
CopyC#
//Open the Buildings feature class Table buildings = Table.OpenFileGeodatabaseTable(@"C:\Data\CalgaryData2.gdb", "Buildings"); //Check that the Table is subtyped if (buildings.IsSubtyped) { //Return the Subtypes from the ColumnCollection Subtypes subs = buildings.Columns.Subtypes; //Print the name of the Column which manages the subtypes System.Diagnostics.Debug.Print(subs.SubtypeColumnName); //Prints "BLDG_CODE" //Return a sorted list (value/description name) containing all the subtypes SortedList<int, string> subtypesList = subs.GetSubtypeValueNamePairs(); //Print out the contents of the subtypes for (int i = 0; i < subs.Count-1; i++) { //Each Key is the subtype value System.Diagnostics.Debug.Print(subtypesList.Keys[i].ToString()); //Each Value is the subtype descriptive name System.Diagnostics.Debug.Print(subtypesList.Values[i].ToString()); } }
CopyVB.NET
'Open the Buildings feature class Dim buildings As Table = Table.OpenFileGeodatabaseTable("C:\Data\CalgaryData2.gdb", "Buildings") 'Check that the Table is subtyped If (buildings.IsSubtyped) Then 'Return the Subtypes from the ColumnCollection Dim subs As Subtypes = buildings.Columns.Subtypes 'Print the name of the Column which manages the subtypes System.Diagnostics.Debug.Print(subs.SubtypeColumnName) 'Prints "BLDG_CODE" 'Return a sorted list (value/description name) containing all the subtypes Dim subtypesList As SortedList(Of Integer, String) = subs.GetSubtypeValueNamePairs() 'Print out the contents of the subtypes For i As Integer = 0 To subs.Count - 1 'Each Key is the subtype value System.Diagnostics.Debug.Print(subtypesList.Keys.Item(i).ToString()) 'Each Value is the subtype descriptive name System.Diagnostics.Debug.Print(subtypesList.Values.Item(i).ToString()) Next End If