New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

toggleGroup

Method which expands/collapses a group. It receives as a parameter the closest data row to the group header or directly the group header. The method accepts an optional parameter called Options.It provides more control over the expand\collapse behavior.

"Options" parameter properties
expandChildrenWill expand all child groups
expandParentsWill expand all parent groups
collapseChildrenWill collapse all child groups
collapseParentsWill collapse all parent groups
toggleChildrenWill expand/collapse all child groups according to the state of the current group
toggleParentsWill expand/collapse all parent groups according to the state of the current group
findClosestGroupWill expand the first parent group

Example:

JavaScript
function ToggleGroupUsingDataItem() {
    var masterTableView = $find("<%=RadGrid1.ClientID %>").get_masterTableView();
    var dataItems = masterTableView.get_dataItems();
    masterTableView.toggleGroup(dataItems[5].get_element(),
    {
        toggleChildren: false,
        toggleParents: true
    });
}

function ToggleGroupUsingGroupHeader() {
    var masterTableView = $find("<%=RadGrid1.ClientID %>").get_masterTableView();
    var groupHeader = $telerik.getElementsByClassName(masterTableView.get_element(), "rgGroupHeader")[3];
    masterTableView.toggleGroup(groupHeader,
    {
        toggleChildren: false,
        toggleParents: true
    });
}
Not finding the help you need?
Contact Support