Expand/Collapse radgrid in jquery

So after reading dozens and dozens of forums I finally just gave up on figuring out the obscure way to deal with hierarchy in a Telerik RadGrid. The classes are easy to find and the expand sections are just Submit buttons. So some super simple JQuery allows you to manipulate them quite easily. You can expand a few rows in your own grid and run these in Console.

$('.rgMasterTable tr td.rgExpandCol input.rgCollapse[type=submit]').click();

$('.rgMasterTable tr td.rgExpandCol input.rgExpand[type=submit').click();

NOTE: (There is more logic required to iterate (and do a wait) for each if there are multiple expansions).

1 comment:

Sqiar BI said...
This comment has been removed by a blog administrator.