Sometimes you may want to expand/collapse a grouped row with a single click (just like Windows XP collapsible panel). To achieve this, here is the solution.
void radGridView_CellClick(object sender, GridViewCellEventArgs e) { if (sender is Telerik.WinControls.UI.GridGroupExpanderCellElement) return; GridViewGroupRowInfo rowInfo = e.Row as GridViewGroupRowInfo; if (rowInfo == null) return; rowInfo.IsExpanded = !rowInfo.IsExpanded; }
Pay attention to code in line 3 and 4, since RadGridView already handled single click event, in this event handler, we need to exclude it.
No comments:
Post a Comment