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

GroupDescriptor and ColumnGroupDescriptor

4 Answers 149 Views
GridView
This is a migrated thread and some comments may be shown as answers.
vk
Top achievements
Rank 1
vk asked on 31 Jan 2012, 10:07 PM
I would like to predefine some groups and added a GroupDescriptor object to QDSCV.GroupDescriptors collection. And the QDSCV is my GridView's ItemsSource. But in the UI users can group by the same column twice. It's not expected behaviour.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Feb 2012, 08:34 AM
Hi,

 You can predefine grouping using ColumnGroupDescriptor in a view model between your data and your UI layer. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
vk
Top achievements
Rank 1
answered on 01 Feb 2012, 09:31 AM
Hi Vlad,

Do you mean I have to create UI elements in my ViewModel class or I misunderstood something? The ViewModel doesn't (and shouldn't) know anything about my View class where a GridView and all the GridViewColumns are defined using just XAML.

Thank you.
0
Vlad
Telerik team
answered on 01 Feb 2012, 09:56 AM
Hello,

 The view model (MVVM) is about separation of concerns and reusability and ColumnGroupDescriptor are not UI elements. You can check for more info our demos to know more about how bind the grid columns from your models, predefine sorting, filtering, grouping, etc.

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
vk
Top achievements
Rank 1
answered on 01 Feb 2012, 12:33 PM
Hi Vlad,

I couldn't find any example of using a ColumnGroupDescriptor in viewmodels and I would be gratefull if you point me at some place where it is described. I know how to create it in XAML or code-behind class for a view, but since a ColumnGroupDescriptor requires a GridViewColumn from Telerik.Windows.Controls namespace I don't get the point for placing it in viewmodels.

Thank you in advance!
Tags
GridView
Asked by
vk
Top achievements
Rank 1
Answers by
Vlad
Telerik team
vk
Top achievements
Rank 1
Share this question
or