HI,
Continued to the above question, I am giving some more information.
Here I am creating a new polygon graphic by using draw object and then want to add this graphic
to be a part of a featureLayer(f). The featureLayer has like 50 attributes. I only add a few attributes to the created graphic since i dont need to add the rest.Can we even do this.
Code below
if (draw.DrawMode == DrawMode.Polygon)
{
ESRI.ArcGIS.Client.Geometry.Polygon polygon = args.Geometry as ESRI.ArcGIS.Client.Geometry.Polygon;
polygon.SpatialReference = MyMap.SpatialReference;
Graphic graphic = new Graphic()
{
Symbol = SelectFillSymbol,
Geometry = polygon
};
string GUID = Guid.NewGuid().ToString();
string OBJECTID_1 = Guid.NewGuid().ToString(); //adding a uniqe id
graphic.Attributes.Add("A1",GUID);
graphic.Attributes.Add("A2",null);
graphic.Attributes.Add("A3",null);
graphic.Attributes.Add("A4",null);
f.Graphics.Add(graphic); //throws an error out of range of valid values
f.SaveEdits();
draw.IsEnabled = false;
}