Binding datagrid to nested collections in collections

I am trying to associate a datagrid with data from a collection of a datacontext collection. The result should be as if all sub collections were only one collection, the properties of the parent collection are still available.

for instance

I have a number of order related products, and each product can have multiple values. I want to show this data in a datagrid with a line showing each cost for each product, ideally without grouping the data.

Structure (pseudo, I use VB)

Class Order
dim Reference as string
dim Order as Date
Dim Products as BindingList(of Product)
End Class

Class Product
Dim ProductName as string
Dim PartNumber as string
Dim Costs as BindingList(of Cost)
End Class

Class Cost
Dim Supplier As string
Dim Value as double
End Class

The DataGrid that I would like to see will be

ProductName | PartNumber | Supplier | Value

This will display all costs associated with the order.

itemsource datagrid , ProductName PartNumber. , , ?

, ,

,

+3
1

, DataGrid, . Telerik, .

0

Source: https://habr.com/ru/post/1762838/


All Articles