7 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 12 Dec 2008, 09:54 AM
Hi Albert,
You can check whether an grid row is expanded or not in the PreRender event of the Grid as shown below.
CS:
Shinu
You can check whether an grid row is expanded or not in the PreRender event of the Grid as shown below.
CS:
protected void RadGrid1_PreRender(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
{ |
if (item.Expanded) |
{ |
} |
} |
} |
Shinu
0

Albert
Top achievements
Rank 1
answered on 13 Dec 2008, 08:16 AM
Still wont work. Can someone plz help me on this part.
PseudoCode:
if (e.CommandName == RadGrid.ExpandCollapseCommandName)
if (e.Item.Expanded == false)
AttachTableView(e.Item.OwnerTableView.DetailTables);
--
AttachTableView(GridTableViewCollection TableCollection){
GridTableView GTV = new GridTableView();
...*assign columns / datasource to GTV*
TableCollection.Add(GTV);
}
Anyways, that should have made a new table on the heirarchy everytime I drop-down but its not showing. Plz help
PseudoCode:
if (e.CommandName == RadGrid.ExpandCollapseCommandName)
if (e.Item.Expanded == false)
AttachTableView(e.Item.OwnerTableView.DetailTables);
--
AttachTableView(GridTableViewCollection TableCollection){
GridTableView GTV = new GridTableView();
...*assign columns / datasource to GTV*
TableCollection.Add(GTV);
}
Anyways, that should have made a new table on the heirarchy everytime I drop-down but its not showing. Plz help
0

Albert
Top achievements
Rank 1
answered on 15 Dec 2008, 04:03 AM
Up
0

Albert
Top achievements
Rank 1
answered on 16 Dec 2008, 01:45 AM
Bump
0
Hello Albert,
Adding detail tables dynamically inside the ItemCommand handler is not a proper approach because this is a postback event handler and the viewstate of the newly added nested tables will not be persisted/will become corrupted on subsequent submits.
If you want to generate the tables on demand, there are two possible options:
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Adding detail tables dynamically inside the ItemCommand handler is not a proper approach because this is a postback event handler and the viewstate of the newly added nested tables will not be persisted/will become corrupted on subsequent submits.
If you want to generate the tables on demand, there are two possible options:
- Choose HierarchyLoadMode = ServerOnDemand (default mode) for your hierarchy. The supported hierarchy load modes are outlined in this help article.
- Generate the grid programmatically inside the PageInit handler of the page as explained here:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Programming/Hierarchy/DefaultCS.aspx
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Albert
Top achievements
Rank 1
answered on 16 Dec 2008, 09:55 AM
So there is no other way? What I need is to create new detailtables and attach it to newly expanded heirarchies.
Like
Customer
>> Orders
>> Order_Details
>> Employees
>> Orders
>> CustomerDemographics
>> Customer
>> Orders
>> Order_Details
>> Employees
That heirarchy will never end, so I can't make it on init coz it will loop forever. But by adding it on expand... I can make the same structure.
>_>
Like
Customer
>> Orders
>> Order_Details
>> Employees
>> Orders
>> CustomerDemographics
>> Customer
>> Orders
>> Order_Details
>> Employees
That heirarchy will never end, so I can't make it on init coz it will loop forever. But by adding it on expand... I can make the same structure.
>_>
0
Hello Albert,
The dynamical hierarchy structure you describe is not supported with standard hierarchy. As an alternative you may consider utilizing the self-referencing hierarchy feature of our web grid presented here:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Hierarchy/SelfReferencing/DefaultCS.aspx
Best regards,
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The dynamical hierarchy structure you describe is not supported with standard hierarchy. As an alternative you may consider utilizing the self-referencing hierarchy feature of our web grid presented here:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Hierarchy/SelfReferencing/DefaultCS.aspx
Best regards,
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.