Steeven_b
Steeven_b

Reputation: 777

Both vertical and horizontal data in WPF Datagrid

I'm struggling at making a datagrid that looks like this :

|Column 1 | Column 2| | data1 | data2 | |Column 3 | data3 |

I've no problem doing this using a simple grid and defining rows + columns but I can't do it using a datagrid because <DataGrid.Rows> is not available. The only few posts I found about it suggested to make a grid but if it's possible to do that using a DataGrid, I would appreciate it.

Upvotes: 0

Views: 197

Answers (1)

mm8
mm8

Reputation: 169150

The DataGrid maps a column to a property of the underlying type T in its IEnumerable<T> ItemsSource, and generates a row per instance of T. This is how it works basically.

If you want to be able to add columns or/and rows in some other way, you should use a different approach. The built-in DataGrid control won't work as expected anyway.

Upvotes: 1

Related Questions