ESRI.ArcGIS.Mobile
Columns Property
See Also  Example Send Feedback
ESRI.ArcGIS.Mobile.MobileServices Namespace > FeatureLayer Class : Columns Property

Returns the column collection representing attribute fields in a feature layer.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Columns As ReadOnlyColumnCollection
C# 
public ReadOnlyColumnCollection Columns {get;}

Example

Assuming you have a feature layer in the map control (map1) and you are interested in finding the index of a known column or field. you can use the code below.
C#Copy Code
FeatureLayer fl = map1.MapLayers[0].Layer as FeatureLayer; 
if (fl == null) 
  return; 
System.Diagnostics.Debug.Print(Fl.Columns.IndexOf("myfield").ToString()); 
//To see the column name of the first one in the collection 
System.Diagnostics.Debug.Print(Fl.Columns[0].ColumnName); 
 
   

Remarks

The Columns collection is not ordered by the map document, so you should access your data using the column or field name. For more information about columns collection, see corresponding chapter in ADO.NET help.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also