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

Problem with Grouped event of RadGridView

10 Answers 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Umbala
Top achievements
Rank 1
Umbala asked on 23 Apr 2011, 10:28 AM
Hi team Telerik
Why Grouped event was not  fired when using GroupDescriptors  ?
Thanks!

 

10 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 23 Apr 2011, 10:50 AM
Hi Umbala,

 

Indeed the behavior you get is the expected one. Since Q3 2010 release a breaking change was that the Grouping and Grouped events now fire only when a grouping operation has been performed on the UI. 
May you please share with us a little bit more details about your exact scenario? Thus we would be able to provide you with an appropriate solution.


Kind regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rupendra
Top achievements
Rank 1
answered on 25 Apr 2011, 07:11 PM
Hello,

I have the exact same issue because the column I am grouping contains empty cells and hence after the grouping I end up with a group with no group name/header (it's empty string). Is there I can replace it with something like "Others" or "Empty" ?

I am putting the group descriptors programmatically.

Moreover, is there a way that I can place that group at the end of all the groups ?
0
Vanya Pavlova
Telerik team
answered on 26 Apr 2011, 07:44 AM
Hello Rupendra,

 

You may predefine the GroupHeaderTemplate either at a grid level or at a column level. There you may implement your custom logic and using a single converter you may return whatever you need through examining the underlying property value, please refer to the following:

<telerik:GridViewDataColumn.GroupHeaderTemplate>
    <DataTemplate>
        <TextBlock Text="{Binding Group.Key,Converter={StaticResource converter}}"/>
    </DataTemplate>
</telerik:GridViewDataColumn.GroupHeaderTemplate>


Since you are adding the GroupDescriptors in code behind you need to ensure that the ColumnGroupDescriptor associated with this column is added last to RadGridView's descriptors, you may read more about this here. 


 


Greetings,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rupendra
Top achievements
Rank 1
answered on 26 Apr 2011, 04:15 PM
Thanks for the reply Vanya. Well, now I can replace an empty string in the group header with a text such as "Others" however the problem with this is that since text is replaced (by the converter) after the group headers have been applied and sorted the text Others sits on the top of the list of group headers and the list obviously doesn't seem to be sorted anymore.

Is there a way that

this text can be replaced either before the sorting of the group headers 
OR
a sorting with the replaced text can be triggered afterwards
OR 
to manually place this group header at the end of all the group headers ?
0
Vanya Pavlova
Telerik team
answered on 27 Apr 2011, 09:53 AM
Hi Rupendra,

 

I believe that the following forum thread would be useful for you on that matter.
Please let me know how this corresponds in your custom scenario.


Greetings,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rupendra
Top achievements
Rank 1
answered on 27 Apr 2011, 08:25 PM
Unfortunately, this article does not help because I have already done all that this article says. I already have the null value replaced by another text, but since null comes before every other value, the replaced text is also placed before every value. But just like Matt in the other thread, I want this group item with the replaced text moved to the bottom of the list which is not happenning at the moment.

Other than the ways I asked for that could be used to do this in the last post, another way this can be done is if I or the developer can specify my own sorting function that is used for sorting the group headers. Suggestions ?
0
Vanya Pavlova
Telerik team
answered on 28 Apr 2011, 08:31 AM
Hi Rupendra,

 

As my colleague Tsvyatko suggested in the previously referenced thread, you may define sort direction for the current group descriptor using its SortDirection property. In addition to this in case you need to move the null values at the bottom, you have to combine custom property approach with using the converter - the property value will affect the position of the group while converter will take care of the display value. Both of these approaches are applicable in this case. In order to avoid any further misunderstandings you may attach some shapshot that would give us a little bit more information about the desired final result. 


Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rupendra
Top achievements
Rank 1
answered on 28 Apr 2011, 03:43 PM
So here I am attaching two screenshots. In both the cases the group is ordered in ascending order. The application makes use of a converter to change the null value to the string "Others". The first one is before a converter is attached and the second one is after the converter is used.

Please note that even after the converter is used the string "Others" just stays at the position where the null value would have been. At the moment we need to know a way to push this value at the bottom of this list.
0
Vanya Pavlova
Telerik team
answered on 28 Apr 2011, 03:48 PM
Hi Rupendra,


Thank you for sharing these pictures to us! 
I believe that there is something custom in your project and it would be great if you can send us a small application in a new support ticket which we can test locally.


All the best,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rupendra
Top achievements
Rank 1
answered on 28 Apr 2011, 07:30 PM
I don't understand the confusion here. It is doing exacly what you say it should do in your last reply

..."you may define sort direction for the current group descriptor using its SortDirection property. In addition to this in case you need to move the null values at the bottom, you have to combine custom property approach with using the converter - the property value will affect the position of the group while converter will take care of the display value."...

So before applying the converter, an empty value (which is the fallback value for a null) is shown at the top. Moreover since an ascending grouping is applied on the group you see all items sorted in ascending order as well. When the converter is executed it just replaces the text which is null to something else. The converter does nothing to change the position of the group header in the list of group headers.

Are you suggesting I apply some other converter in some other way ?
Tags
GridView
Asked by
Umbala
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Rupendra
Top achievements
Rank 1
Share this question
or