Select to view content in your preferred language

featuredatagrid silverlight  with tabs

1388
4
11-05-2010 07:14 AM
JoseSanchez
Frequent Contributor
Hi all

How can I add tabs to a featuredatagrid?

regards
jose
0 Kudos
4 Replies
AliMirzabeigi
Emerging Contributor
Jose,

Could you be more specific on the use case you are trying to cover?
0 Kudos
JoseSanchez
Frequent Contributor
Sure!!

I need to display a grid with the following characteristics:
-  the result of a selection from a feature polygon class  in one tab 
- and all the documents associated to the selected feature in the other tab. Drawings are located in a related table.

The feature grid is going to have 2 tabs:
- facility
- as-builts 

I need a master detail featuredatagrid
please advise
0 Kudos
AliMirzabeigi
Emerging Contributor
In order to achieve a Master/Detail view in a FeatureDataGrid you need to associate "RowDetailsTemplate" to each row. After setting the "AutoGenerateColumns" property to false set the column colection using something similar to the following code snippets:

xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"


<esri:FeatureDataGrid.Columns>
    <data:DataGridTextColumn Header="State" Binding="{Binding [STATE]}"/>
        ...
</esri:FeatureDataGrid.Columns>


And to set "RowDetailsTemplate" do the following:
<esri:FeatureDataGrid.RowDetailsTemplate>
    <DataTemplate>
        <StackPanel Margin="10">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Number of Households: " FontWeight="Bold" />
                <TextBlock Text="{Binding [HOUSEHOLDS]}" Margin="0,5,0,0" />
           </StackPanel>
           ...
        </StackPanel>
    </DataTemplate>
</esri:FeatureDataGrid.RowDetailsTemplate>


The above code snippets shows you how to show "STATE" attribute of your layer as a column header with an alias name "State". When your row is expanded other attributes such as "HOUSEHOLDS"... will be shown in a specified layout.

Also, need to mention that you can optionally set the behavior of showing the detail view using the "RowDetailsVisibilityMode" property, e.g. always visible, visible when selected...

Since FeatureDataGrid is an inherited control from Microsoft DataGrid control you get all its functionalities and behaviors and I suggest you to also take a look at the following URL:
http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.rowdetailstemplate(VS.95).a...

Hope you'll get the idea 🙂
0 Kudos
AnkitKhattri2
New Contributor
Problem while binding feature datagrid with more then 1000 records.. it gets hanged...
0 Kudos