Select to view content in your preferred language

Editor Widget (Attribute update issue)

1540
10
09-06-2011 06:20 AM
JerryBiedenbender
New Contributor
Hello,

    I am using the editor widget in my silverlight application and am having a small issue with updating attributes. I can update every field except for the field that the symbology is based on. Does anyone know how to correct this issue?

Thanks,
Jerry
0 Kudos
10 Replies
JenniferNery
Esri Regular Contributor
Sure, you can try this. Before setting FeatureDataForm.GraphicSource, you can update the graphic attribute value first, if it is found to be null. This uses Linq query to search for all CodedValueDomain.
var fields  = l.LayerInfo.Fields.Where(f => f.Domain is CodedValueDomain && (f.Domain as CodedValueDomain).CodedValues.Count > 0);
foreach (var f in fields)
{
  if (g.Attributes[f.Name] == null)
  {
    var d = f.Domain as CodedValueDomain;
    g.Attributes[f.Name] = d.CodedValues.FirstOrDefault().Key;
  }
}
0 Kudos