Shahin
Shahin

Reputation: 12851

Dynamic columns on WPF

Assume we have a DataGrid like this :

enter image description here

First column is constant. others are come from database. In columns we display name of football players for example and below them we display some statistics about them .

What control do you suggest to use ? If you suggest DataGrid how do I create columns and rows and connect them to data source ?
Any code example would be appreciated.

Upvotes: 0

Views: 246

Answers (1)

Mitch
Mitch

Reputation: 22301

The functionality you are looking for is typically called a pivot table or Matrix. See Dynamic data matrix WPF for an example of how to do so in WPF.


Edit: If you are not trying to pivot, but just rotate it 90 degrees, there is a rather good answer on how to do that, too: WPF horizontal DataGrid. Basically just use a couple of LayoutTransforms to rotate the whole thing, then another set to rotate the cells back to normal.

Upvotes: 1

Related Questions