WPF combines two collections in one DataGrid

I have two collections that I want to display together in the same table. I intend to use a horizontal DataGrid for this, and I'm trying to figure out what is the best way to open collections in a DataGrid. (horizontal DataGrid solution described here: horizontal DataGrid WPF )

A little pointless example with chairs and tables. In my application, I have a list of tables and a list of chairs (both tables and chair have Date and NumberOfItems property):

public List<Table> TableList { get; set; }
public List<Table> ChairList { get; set; }

In xaml, I want a DataBind in a combined list to get something like:

Date             | 01-Jan-2011 | 02-Jan-2011 | 03-Jan-2011 | 04-Jan-2011 
Number of tables |     5       |     6       |             |     7       
Number of chairs |     3       |             |     2       |       

TableList and ChairList do not have the same number of elements. What would be the best approach to discovering a federated collection with binding?

+3
2

DataGrid DataTable DataView. FurniturePerDate FurniturePerDate DataTable. , .

+1

CompositeCollection. , . - , , , Xaml .

+7

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


All Articles