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

GroupDescriptor specify title?

1 Answer 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kenneth Jamieson
Top achievements
Rank 1
Kenneth Jamieson asked on 21 Oct 2009, 10:34 PM
In code like this...

                pagesGridView.GroupDescriptors.Add(  
                    new GroupDescriptor {   
                        Member = "CmsPageParent.Title",   
                        SortDirection = ListSortDirection.Ascending   
                    }  
                ); 

How do I set the "title" property of the group? I need to simulate the grouping of a column named “Parent” – as far as I can see I cannot mark a column as a default grouping set so I need to do it programmatically. However when I do it this way the resulting item in the group header says “CmsPageParent.Title” not “Parent” as the header for the same column would.

Ideas?

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 23 Oct 2009, 09:35 AM

Hello Kenneth Jamieson,

The GroupDescriptor has a DisplayContent property.

So you may do this in code :

pagesGridView.GroupDescriptors.Add(
                    new GroupDescriptor
                    {
                        DisplayContent = "Parent",
                        Member = "CmsPageParent.Title",
                        SortDirection = ListSortDirection.Ascending
                    });

Or if you prefer you may set it as a default groupping in XAML :

<telerik:RadGridView x:Name="pagesGridView" >
            <telerik:RadGridView.GroupDescriptors>
                <telerik:GroupDescriptor  Member = "CmsPageParent.Title" SortDirection = "Ascending" DisplayContent="Parent"/>
        </telerik:RadGridView.GroupDescriptors>
        </telerik:RadGridView>


Greetings,

Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Kenneth Jamieson
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or