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

[Solved] Expand one row at a time

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mydatafactory
Top achievements
Rank 1
Mydatafactory asked on 09 Apr 2009, 02:38 PM
I have a question about a very simple issue. Despite searching the forum and the demo's I cannot find the solution...

I have a hierarchial grid. When the expand button of 1 row in level 1 is clicked, the next level appears. When another row in level 1 is clicked the next level also appears. So now 2 rows on level 1 are expanded

I would like to have the next behavior: When 1 row on level 1 is expanded and another expand button of a row on level 1 is clicked, the already expanded row collapses.

I hope I'm clear enough.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Apr 2009, 02:07 PM
Hello A. Bennen,

If you want to allow single row expand at a time for each level in the grid hierarchy, you merely need to:
            - Hook the ItemCommand event and check whether e.CommandName is RadGrid.ExpandCollapseCommandName 
            - Traverse all items in the currently active GridTableView 
            - Set the Expanded property for all items which differ from the e.Item instance to false.

More information about Single expand in hierarchical grid is available in this help topic.

I hope this information helps.

Regards,
Pavlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Mydatafactory
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or