Using ExpandCollapseCommandName from Parent Grid

2 posts, 0 answers
  1. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 07 Sep 2011 Link to this post

    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
  2. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 07 Sep 2011 Link to this post

    I found the problem. HierarchyLoadMode = GridChildLoadMode.Client should have been set to HierarchyLoadMode = GridChildLoadMode.ServerBind
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top