Select to view content in your preferred language

Filla combo with the fields of a table

895
2
09-18-2011 10:18 PM
JoelFerreyra
Emerging Contributor
Hi, maybe this is too simple for some, but I'm still new to programming things .... I want to fill a combo with the fields of a table of a Featureclase that is located in a geodatabase (and I have loaded into the TOC). I am working with Visual Net 2008 and ArcGIS 10.
😃
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
Here's a code fragment that will do that

'pFClass is your Feature class
'cboFields is the combo box

Dim pFields As ESRI.ArcGIS.Geodatabase.IFields2
Dim pfield As ESRI.ArcGIS.Geodatabase.IField

pFields = pFClass.Fields
For i As Integer = 0 To pFields.FieldCount - 1
    pfield = pFields.Field(i)
    cboFields.Items.Add(pfield.Name)
Next (i)
0 Kudos
JoelFerreyra
Emerging Contributor
Sorry, I can not make it work  😞
0 Kudos