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

[Solved] Expand All / Collapse All using Server-On-Demand

3 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 14 May 2008, 06:03 AM
Hi

Is there a way to expand all the detail tables for a hierarchal grid that uses a server-on-demand approach?

If a grid uses "Client" I can get this working nicely, but I'm not sure how to approach this with server-on-demand.


Kind regards

Mark Eaton

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 May 2008, 06:43 AM
Hi mark,

Try setting the HierarchyDefaultExpanded property to true in the aspx as shown below.

ASPX:
  <MasterTableView  HierarchyLoadMode="ServerOnDemand"  HierarchyDefaultExpanded="true"   DataSourceID="SqlDataSource1"


Thanks
Shinu.

0
Mark
Top achievements
Rank 1
answered on 14 May 2008, 10:59 PM
Sorry Shinu, I should have been more specific.

I have an external button that needs to expand all / collapse all the grid.

Using Javascript, is there a way to 'click' each hierarchy so that it does a load-on-demand?

Also how would the reverse of this be true when collapsing all hierarchies.



Kind regards

Mark Eaton
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 May 2008, 06:21 AM
Hi,

Try the following code snippet.

ASPX:
  <asp:Button ID="Button1" runat="server" Text="Expand/Collapse" OnClick="Button1_Click" /> 

CS:
  protected void Button1_Click(object sender, EventArgs e)  
    {  
        foreach (GridDataItem item in RadGrid1.Items)  
        {  
            item.Expanded = !item.Expanded;  
 
        }  
    } 


Thanks
Princy.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or