Rows in unbound hierarchic grid do not set Expand property when expanded

2 replies. Last post: May 4, 2011 10:25 AM by Robert Pehrson
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

I have an unbound hierarchic grid where the user can expand and collapse the top level rows, and I need to be able to rebuild it on postback with the same rows expanded.  I tried using the Expand property of rows before the postback, but it is never set true.  I also tried handling the OnGroupExpand event, but this does not seem to fire.

To demonstrate these problems, I've added to the Hierarchical_Unbound_Programmatic tutorial.  On the apsx, I added

<script type="text/javascript">
    function OnClientCellDblClick(id,args) {
        var grid = ISGetObject(id);
        var rt = grid.RootTable;
        var rc = rt.GetRowsCount();
        var noneExpanded = true;
        for (i = 0; i < rc; i++) {
            var r = rt.GetRow(i);
            if (r.Expanded) {
                alert('Row ' + i + ' is expanded');
                noneExpanded = false;
            }
        }
        if (noneExpanded) alert('No rows are expanded');
    }

    function OnClientGroupExpand(id) {
        alert('group expanded');
    }
</script>

and in the code behind, I added to the Page_Load method

        grid.LayoutSettings.ClientSideEvents.OnCellDblClick = "OnClientCellDblClick";
        grid.LayoutSettings.ClientSideEvents.OnGroupExpand = "OnClientGroupExpand";

If you run the page and expand a line, the OnGroupExpand does not fire.  If you then double click on any cell, the OnClientCellDblClick function will not find any rows expanded. 

All times are GMT -5. The time now is 9:26 PM.
Previous Next