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

Programmatic Grouping with GroupDescriptors

2 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 27 Feb 2012, 03:47 PM
Hi,

i want to use the programmatic grouping with the xaml code

<

telerik:RadGridView.GroupDescriptors>

<telerik:GroupDescriptor Member="Status"

                                                   SortDirection="Ascending" />

</telerik:RadGridView.GroupDescriptors>

 


it works fine.

But if i want to disable the grouping by removing the "Status" from the Header i am not able to put it back into to Header to sort the GridView again. I am tried to build a workaround with the code IsGroupable="True" but nothing happens.

Okay i tried to start again and remove ALL the code from the xaml, but now not even manually grouping is possible....!?!?
I am a little bit confused i hope you guys can help me to find the problem!

Thanks a lot

Daniel

2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 27 Feb 2012, 04:48 PM
Hi Daniel,

If I understand correctly you need to initially group by "Status" and later prevent the user from ungrouping  by "Status" ?

If this is the case - you will need to handle the GroupingEvent of RadGridView. Inside the event handler check the action and if it is ungrouping by the "status field" - cancel it ( e.Cancel=true).

Let me know  in case you need additional assistance on this one.

Regards,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Daniel
Top achievements
Rank 1
answered on 27 Feb 2012, 04:57 PM
Hi Pavel,

hmmm no not really, first of all i just want to remove the automatic grouping function completely from the project. But since i tried to implement the, i call it "startup-grouping", i cannot remove it from the project.

I tried to delete the complete code:

<telerik:RadGridView.GroupDescriptors>

>

<telerik:GroupDescriptor Member="Status"

                                                   SortDirection="Ascending" />

</telerik:RadGridView.GroupDescriptors>

but now i am not able to group the Grid again because the Groupsymbol of the Status Column is missing, i am not sure how to bring this function back to the application, is it a failure of the control?

I dont write any other code into the application just these few Lines:
 

<telerik:RadGridView.GroupDescriptors>

>

<telerik:GroupDescriptor Member="Status"

                                                   SortDirection="Ascending" />

</telerik:RadGridView.GroupDescriptors>

I rebuild this problem on 2 different machines with 2 different Versions of our Application.

Thanks for your help

Daniel

Tags
GridView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or