Double list - WPF Toolkit DataGrid
I have a datagrid from wpf Toolkit, with the itemsource binded to a Observable<Item>
. In the Item
Class, I have another O开发者_Go百科bservable<bool>
list containing the values to be displayed.
I want to display these values in a custom template. If possible, I want to show other rows as well (which are normal Properties).
How can I perform this? Thank you for your answers.
Update (just to make clear): the second list should be displayed in normal columns, not as master/detail. Imagine the second list would contain 2 bools
, and the Item class contains 1 extra property. In that case, 3 columns should be shown.
You can create second datagrid and bind SelectedItem.Items
from first grid to itemssource of second. Or you can include second datagrid in row details of your datagrid like this:
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<DataGrid ItemsSource="{Binding Items}"/>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
Take a look at this examples and this
You can write attached property to datagrid which will create additional columns for you on grid. This property implementor will define binding with individual Observable values.
精彩评论