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

Get ID of clicked grouping expand/collapse button

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Juan
Top achievements
Rank 1
Juan asked on 02 Apr 2014, 07:47 AM
Hey There,

I have a RadGrid which currently works with its GroupLoadMode set to SERVER. This way, I can preserve expanded and collapsed groups and set the grid back to the way it was after a postback was made to the server. However, I would like to change the GroupLoadMode to CLIENT in order to speed up the UI. The same code will still remain to put the grid back to its state it was before a postback was requested, but since I'm handling it on the client, I need to get the INDEX of the group that was just expanded (or the Expand/Collapse Button's ID) in order to add/remove that value from the hidden field where I save expanded group's IDs.

So what am I asking here: (a) Get the grouping index of the item being expanded on the client side, or (b) Get the ID of the expand/collapse button of the group on the client side.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 07 Apr 2014, 10:51 AM
Hello Juan,

You can use the following approach to get the button:
<ClientSettings AllowDragToGroup="true">
    <ClientEvents OnGroupCollapsing="toggleGrouping" OnGroupExpanding="toggleGrouping" />
</ClientSettings>
JavaScript:
function toggleGrouping(sender, args) {
    var button = document.activeElement;
    alert(button.id);
}

Hope this helps.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Juan
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or