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

Using ExpandCollapseCommandName from Parent Grid

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 2
Tim asked on 07 Sep 2011, 09:41 PM
I have a Hierarchical DataGrid that is created in a class then displayed dynamically to the form. I am unable to get the  ExpandCollapseCommandName to work on postback in the ItemCommand Event below.

private void ActiveBatchesRadGrid_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        GridTableView _gridTableView = (GridTableView)e.Item.OwnerTableView;
    }
    if (e.CommandName == RadGrid.ExportToExcelCommandName)
    {
        GridTableView _gridTableView = (GridTableView) e.Item.OwnerTableView;
        _gridTableView.GetColumn("PolicyEditRecord").Visible = false;
        _gridTableView.GetColumn("PolicyDeleteRecord").Visible = false;
        this.__activeBatchesRadGrid.MasterTableView.HierarchyDefaultExpanded = true;
    }
    if (e.CommandName == RadGrid.ExpandCollapseCommandName)
    {
        e.Item.Selected = !e.Item.Expanded;
    }
}


What I would like to do is to GetDataKeyValue() of the parent row when a parent row is expanded

1 Answer, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 2
answered on 08 Sep 2011, 03:04 AM
I found the problem. HierarchyLoadMode = GridChildLoadMode.Client should have been set to HierarchyLoadMode = GridChildLoadMode.ServerBind
Tags
Grid
Asked by
Tim
Top achievements
Rank 2
Answers by
Tim
Top achievements
Rank 2
Share this question
or