RadGrid for ASP.NET AJAX

RadControls for ASP.NET AJAX

In some particular scenarios you may want to allow single row expand at a time for each level in the grid hierarchy (due to user preference, custom development conventions, etc.). This feature is not built-in for Telerik RadGrid, however you can provide with only several lines of code. You merely need to:

  1. Hook the ItemCommand event and check whether e.CommandName is RadGrid.ExpandCollapseCommandName

  2. Traverse all items in the currently active GridTableView

  3. Set the Expanded property for all items which differ from the e.Item instance to false

And here is the code of a simple demo: