Hi,
I am developing a silverlight solution to select my graphics object on the basemap from the Datagrid selection i.e., n selcting any row object on the datagrid the corresponding map graphics should be highlighted on the BaseMap. I following the below given code.
DataGrid dataGrid = sender as DataGrid;
GraphicsLayer selectedMapGraphics = edmsMap.Layers["selectionGraphicsLayer"] as GraphicsLayer;
selectedMapGraphics.ClearGraphics();
int selectedIndex = dataGrid.SelectedIndex;
if (selectedIndex > -1)
{
FindResult findResult = (FindResult)QueryDetailsDataGrid.SelectedItem;
Graphic graphic = findResult.Feature;
{
ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol FillSymbol;
FillSymbol = (ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol)(LayoutRoot.Resources["SelectSymbol"]);
graphic.Symbol = (ESRI.ArcGIS.Client.Symbols.Symbol)FillSymbol;
selectedMapGraphics.Graphics.Insert(0, graphic);
}
selectedMapGraphics.Graphics.Add(graphic);
}
But i am getting a exception in the following line of code.
FindResult findResult = (FindResult)QueryDetailsDataGrid.SelectedItem;
The error details are attached in the screen shot. Please let me know if anybody is having any solution to this particular exception to resolve this.
~Saurabh.