Thanks for the reply Hugo.I am loading the feature using this code is it going to work.
[HTML]
void queryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs e)
{
GraphicsLayer graphicsLayer = Map.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.ClearGraphics();
FeatureSet featureSet = e.FeatureSet;
if (featureSet != null && featureSet.Features.Count > 0)
{
foreach (Graphic resultFeature in featureSet.Features)
{
graphicsLayer.Graphics.Add(resultFeature);
}
System.Windows.Data.Binding bind = new System.Windows.Data.Binding();
bind.ElementName = "Map";
bind.Path = new PropertyPath("Layers.[MyGraphicsLayer]");
MyDataGrid.SetBinding(ESRI.ArcGIS.Client.Toolkit.FeatureDataGrid.GraphicsLayerProperty, bind);
MyDataGrid.UpdateLayout();
}
else
{
MessageBox.Show("No features Returned from Query", "Query", MessageBoxButton.OK);
MyDataGrid.Columns.Clear();
foreach (KeyValuePair<string, string> kv in featureSet.FieldAliases)
{
DataGridTextColumn dt = new DataGridTextColumn();
Binding b = new Binding("Attributes");
b.Converter = new ESRI.ArcGIS.Client.ValueConverters.DictionaryConverter();
b.ConverterParameter = kv.Key;
dt.Binding = b;
dt.Header = kv.Value;
}
}
}
[/HTML]
After adding your code the silverlight control just disappeared and whole screen becomes blank.I am
using following code
[HTML]
<esri:FeatureDataGrid VerticalAlignment="Bottom" IsReadOnly="True" HorizontalAlignment="Stretch" x:Name="MyDataGrid" Height="162" Margin="0,0,1,2" GraphicsLayer="{Binding ElementName=Map, Path=Layers.[Sewer_Lines]}" BorderBrush="Black" BorderThickness="1" Grid.RowSpan="2" SelectionChanged="MyDataGrid_SelectionChanged" MouseLeftButtonDown="MyDataGrid_MouseLeftButtonDown"></esri:FeatureDataGrid>
[/HTML]