Peekay
Peekay

Reputation: 451

Grid View Dynamic column headers WPF MVVM

How do I create a grid view with dynamic column headers by binding the data from ViewModel?

I am trying to created a grid like this.

Id --- Name --- [Name of games played "other detail I will get from the model"] 

For example if I have played 5 games I have to create a grid with a header like the following

Id -- Name ---- Soccer -- Tennis ---Golf ----- Cricket --- Polo

How can I achieve this using MVVM binding in XAML? Please advise.

Thanks in advance.

Upvotes: 0

Views: 4368

Answers (1)

Frank
Frank

Reputation: 4481

This question is possibly a duplicate of WPF MVVM: how to bind GridViewColumn to ViewModel-Collection?

You might want to look into this answer: https://stackoverflow.com/a/2644202/4317569

Upvotes: 1

Related Questions