This is a migrated thread and some comments may be shown as answers.

ColumnGroups MVVM way

1 Answer 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
gans
Top achievements
Rank 1
gans asked on 09 Aug 2012, 10:05 PM
Currently I am doing the ColumnGroups from the code behind like this.

grid.ColumnGroups.Add(new GridViewColumnGroup
                                                      {
                                                          Name = groupName,
                                                          Header = groupName
                                                      });
gridColumn = new GridViewDataColumn();
gridColumn.ColumnGroupName = groupName;    
grid.Columns.Add(gridColumn);

But I want to do the same thing using MVVM way. Do you guys have an example project that does this using MVVM?

Any help is greatly appreciated. 

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 Aug 2012, 06:12 AM
Hi,

Maybe you can create attached behavior where you can add/binding columns/column groups from a view model. You can check your local copy of our demos for more info how for example we bind columns to various grids from a view-model.

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
gans
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or