i reproduce attribute query with data grid , every thing is fine but now the problem is when i select the feature its give me invalid cast exception,
this code working well in another query.
private void FindDetails_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// Highlight the graphic feature associated with the selected row
DataGrid dataGrid = sender as DataGrid;
int selectedIndex = dataGrid.SelectedIndex;
if (selectedIndex > -1)
{
FindResult findResult = (FindResult)FindDetailsDataGrid.SelectedItem;
Graphic graphic = findResult.Feature;
switch (graphic.Attributes["Shape"].ToString())
{
case "Polygon":
graphic.Symbol = LayoutRoot.Resources["HighlightFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Polyline":
graphic.Symbol = LayoutRoot.Resources["HighlightLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Point":
graphic.Symbol = LayoutRoot.Resources["PointMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
}
graphic.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
Which line is throwing the error? Can you share some more code?