开发者

Double list - WPF Toolkit DataGrid

开发者 https://www.devze.com 2023-02-13 21:42 出处:网络
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 displ

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号