Hi to all, i've an error at the end of field task, in the FindDetails_SelectionChanged of my datagrid output.
If i find a polygon or a line all works good , if i find a point i have an error on the red istruction below when i try to obtain shape type.
Maybe a spatial reference problem ? I'm using a find task on a service with a point layer inside. the layer spatial reference is 3857 and the map is 102100.
The error is "Object reference not set to an instance of an object."
What can it be ?
Thanks GP
DataGrid dataGrid = sender as DataGrid;
int selectedIndex = dataGrid.SelectedIndex;
if (selectedIndex > -1)
{
FindResult findResult = (FindResult)
_Parent.MyDataGridOutput.QueryDetailsDataGrid.SelectedItem;
Graphic graphic = findResult.Feature;
switch (graphic.Attributes["Shape"].ToString())
{
case "Polygon":
graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Polyline":
graphic.Symbol = _Parent.LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Point":
graphic.Symbol = _Parent.LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
}