I have a RadGrid with 2 inner layers of details tables.
I set this.radGrid.MasterTableView.HierarchyDefaultExpanded = true; before rebinding my grid for the export
but it only expands 1 inner details table.
How to expand all inner details tables?
Thanks,
///<summary>/// Handles the DataBound event of the RadGrid control.///</summary>///<param name="sender">The source of the event.</param>///<param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>protectedvoid RadGrid_DataBound(object sender, EventArgs e)
{
ExpandGridTableView(this.radGrid.MasterTableView, this.ExpandGroupHeaders);
}
///<summary>/// Expands the grid table view.///</summary>///<param name="gridTableView">The grid table view.</param>///<param name="expand">if set to <c>true</c> [expand].</param>privatevoid ExpandGridTableView(GridTableView gridTableView, bool expand)
{
gridTableView.HierarchyDefaultExpanded = expand;
foreach (var detailTable in gridTableView.DetailTables)
{
ExpandGridTableView(detailTable, expand);
}
}
///<summary>/// Handles the DataBound event of the RadGrid control.///</summary>///<param name="sender">The source of the event.</param>///<param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>protectedvoid RadGrid_DataBound(object sender, EventArgs e)
{
ExpandGridTableView(this.radGrid.MasterTableView, this.ExpandGroupHeaders);
}
///<summary>/// Expands the grid table view.///</summary>///<param name="gridTableView">The grid table view.</param>///<param name="expand">if set to <c>true</c> [expand].</param>privatevoid ExpandGridTableView(GridTableView gridTableView, bool expand)
{
gridTableView.HierarchyDefaultExpanded = expand;
foreach (var detailTable in gridTableView.DetailTables)
{
ExpandGridTableView(detailTable, expand);
}
}
///<summary>/// Handles the DataBound event of the RadGrid control.///</summary>///<param name="sender">The source of the event.</param>///<param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>protectedvoid RadGrid_DataBound(object sender, EventArgs e)
{
ExpandGridTableView(this.radGrid.MasterTableView, this.ExpandGroupHeaders);
}
///<summary>/// Expands the grid table view.///</summary>///<param name="gridTableView">The grid table view.</param>///<param name="expand">if set to <c>true</c> [expand].</param>privatevoid ExpandGridTableView(GridTableView gridTableView, bool expand)
{
gridTableView.HierarchyDefaultExpanded = expand;
foreach (var detailTable in gridTableView.DetailTables)
{
ExpandGridTableView(detailTable, expand);
}
}