Select to view content in your preferred language

Reading properties from a FeatureLayer Programmatically

864
2
Jump to solution
02-03-2012 09:43 AM
MarvinOconitrillo
Occasional Contributor
Hi, I'm trying to read the properties of some features I insert before, but happends something strange, it's the following: if a read each property from the features in the layer I can read all the properties from the last one I insert, if I close my silverlight application and run again when I read the properties of the features I can read just some columns and not all of them cause it says are null, but I can see all the information from the arcmap viewing the featurelayer service .
Could someone to tell me what could be the problem?

the structure of my featurelayer is the following:
OBJECTID (Tipo: esriFieldTypeOID, Alias: OBJECTID, Editable: False)
ID (Tipo: esriFieldTypeString, Alias: ID, Longitud: 10, Editable: True)
ASIENTO (Tipo: esriFieldTypeString, Alias: ASIENTO, Longitud: 12, Editable: True)
INGRESO (Tipo: esriFieldTypeDate, Alias: INGRESO, Longitud: 36, Editable: True)
TIPO_INGRESO (Tipo: esriFieldTypeString, Alias: REINGRESO, Longitud: 10, Editable: True)
ANOTACIONES (Tipo: esriFieldTypeString, Alias: ANOTACIONES, Longitud: 100, Editable: True)
NO_INSCRIPCION (Tipo: esriFieldTypeString, Alias: NO_INSCRIPCI??N, Longitud: 12, Editable: True)
COORDENADA_NORTE (Tipo: esriFieldTypeDouble, Alias: COORDENADA_NORTE, Editable: True)
COORDENADA_ESTE (Tipo: esriFieldTypeDouble, Alias: COORDENADA_ESTE, Editable: True)
ESTADO (Tipo: esriFieldTypeString, Alias: ESTADO, Longitud: 1, Editable: True)
ESTADO_CALIFICACION (Tipo: esriFieldTypeString, Alias: ESTADO_CALIFICACION, Longitud: 1, Editable: True)
USUARIO_EDITA (Tipo: esriFieldTypeString, Alias: USUARIO_EDITA, Longitud: 20, Editable: True)
FECHA_EDICION (Tipo: esriFieldTypeDate, Alias: FECHA_EDICI??N, Longitud: 36, Editable: True)
REGISTRADOR (Tipo: esriFieldTypeString, Alias: REGISTRADOR, Longitud: 20, Editable: True)


The code that i'm using to read the properties is this:

foreach (Graphic graphic in flCalificacion.Graphics)
{
   foreach (var f in flCalificacion.LayerInfo.Fields)
   {
        if (graphic.Attributes[f.Name] != null)
             MessageBox.Show(f.Name + ":" + graphic.Attributes[f.Name].ToString());
    }
}



Where flCalificacion is my featurelayer.

I'll appreciate any help
0 Kudos
1 Solution

Accepted Solutions
JenniferNery
Esri Regular Contributor
Have you set FeatureLayer.OutFields? If this only contains a subset, these are the only Attributes that will show when you run your code. If you set OutFields="*", then all fields in your service will be displayed in graphic.Attributes.

View solution in original post

0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
Have you set FeatureLayer.OutFields? If this only contains a subset, these are the only Attributes that will show when you run your code. If you set OutFields="*", then all fields in your service will be displayed in graphic.Attributes.
0 Kudos
MarvinOconitrillo
Occasional Contributor
Thanks Jennifer, I'm getting all the columns now :o.
0 Kudos