Sunday, November 15, 2009

When you use radgrid with master/details hierarchical mode, You can expand multiple rows. If you want stop that and expand one row at a time , use following code


protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.ExpandCollapseCommandName)
        {
            foreach (GridItem item in e.Item.OwnerTableView.Items)
            {
                if (item.Expanded && item != e.Item)
                {
                    item.Expanded = false;
                }
            }
        }
    }   



No comments:

Post a Comment