This thread Defining Results Datagrid In Code behind should help.
@Dominique i want this binding behind C#
How to?
<slData:DataGridTextColumn Binding="{Binding Attributes[FID]}" Header="النتائج" />
If you have included a legend control in your application, you can use it to get the swatches of the sublayers (look at this thread http://forums.arcgis.com/threads/23147-populating-sublayers-on-a-listbox-along-with-the-symbols) else you could call QueryLegendInfos of the service by yourself. Why not just hook up your handler in XAML? <DataTemplate x:Key="FeatureItemDataTemplate"> <Grid MouseEnter="Grid_MouseEnter"> ........
<DataTemplate x:Key="FeatureItemDataTemplate"> <Grid MouseEnter="Grid_MouseEnter"> ........
I also need the legend dymbol for the layer. The image I have in the feature class is to store the legend symbol for the layer. How we can access that information?
Now I need to add a MouseEnter/Leave event to the Listbox that has the result, but this listbox is defined inside the DataTemplate. How and where I could add those event?
The FindResult object contains a feature object with all its attributes. So you can extend your FeatureItem to store other attributes: .OtherAttribute = .elem.Feature.Attributes["AttributeName"]or even to store the whole Feature: .Feature= .elem.FeatureThat will be easier if you store the Feature in your FeatureItem. So (as in the sample) from the SelectedItem, you can retrieve the Feature and show it in a graphics layer.
I need specifics fields from the layer instead what I am getting is the fields that have the information searched.
Also I need functionalities when mouse over the list item to display the feaures it in the map. How I could do that?
Binding resultFeaturesBinding = new Binding("LastResult"); resultFeaturesBinding.Source = findTask; FindDetailsDataGrid.SetBinding(DataGrid.ItemsSourceProperty, resultFeaturesBinding);
<Border BorderThickness="3" BorderBrush="Green" Grid.RowSpan="2" Grid.Column="0" > <Image Source="{Binding PhotoUri}" Stretch="Fill" /> </Border> <dataInput:Label Content="{Binding FeatureLayerName}" Grid.Row="0" Grid.Column="1"/> <dataInput:Label Content="{Binding FeatureLayerItemCount}" Grid.Row="1" Grid.Column="1"/> <ListBox Padding="2" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource ="{Binding Path=FeatureItems}" ItemTemplate="{StaticResource FeatureItemDataTemplate}" />
<Border BorderThickness="3" BorderBrush="Green" Grid.RowSpan="2" Grid.Column="0" > <Image Source="{Binding Feature.Attributes[PhotoUri]}" Stretch="Fill" /> </Border> <dataInput:Label Content="{Binding LayerName}" Grid.Row="0" Grid.Column="1"/> <dataInput:Label Content="{Binding LayerId}" Grid.Row="1" Grid.Column="1"/> <dataInput:Label Content="{Binding Value}" Grid.Row="1" Grid.Column="1"/>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.