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

[Solved] GroupsChanging event does not fire to ungroup custom grouping

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeanne
Top achievements
Rank 1
Jeanne asked on 20 Mar 2013, 10:27 PM
I have my grid's GroupsChanging event handler set up so when the use right-clicks and selects "group by" on a DateTime column, the grid groups instead on a hidden column which contains only the date. This works great.

But when I right-click on select "ungroup" on the same column, the GroupsChanging event never fires! I assume that is because that column is not actually grouped by, but it's problematic. How do I ungroup on this custom, hidden column? Perhaps there is a way I can intercept the ungroup some other way (maybe even client-side)?

FYI: If I display the date-only column, and ungroup on that, it works!

1 Answer, 1 is accepted

Sort by
0
Jeanne
Top achievements
Rank 1
answered on 21 Mar 2013, 12:01 AM
I sorted this one out on my own. I'm not thrilled with the way I had to do it, but it works.

I catch the OnCommand event for the table client-side. If the command name is "UnGroupByColumn" and the command argument is the name of my custom-grouped datetime column, I cancel the event and then call the mastertableview ungroupColumn method with the name of the date-only column. The grid posts back, the GroupsChanging event is triggered, and I don't even have to handle it! The altered column name I specified is automatically removed from grouping!
Tags
Grid
Asked by
Jeanne
Top achievements
Rank 1
Answers by
Jeanne
Top achievements
Rank 1
Share this question
or