/// <summary> /// Handles invocation of BeforeExpand events /// </summary> internal bool DoBeforeExpandEvent( GridPanel gridPanel, GridContainer container, ExpandSource expandSource) { if (BeforeExpand != null) { GridBeforeExpandEventArgs ev = new GridBeforeExpandEventArgs(gridPanel, container, expandSource); BeforeExpand(this, ev); return (ev.Cancel); } return (false); }
void SuperGridBeforeExpand(object sender, GridBeforeExpandEventArgs e) { if (e.GridPanel == _Panel) { if (e.GridContainer.RowsUnresolved == true) { e.GridContainer.RowsUnresolved = false; GridRow row = e.GridContainer as GridRow; if (row != null) { DataRowView view = row.DataItem as DataRowView; if (view != null) { DataTable dt = view.DataView.Table; StringBuilder sb = new StringBuilder(); foreach (DataRelation dr in dt.ChildRelations) CreateNestedPanel(e.GridPanel, row, dr, sb); } } } } }