Hi,
I have a RadGrid with a detailtable.
Given a certain condition i would like to expand an item dynamically usiong the following code
Just setting the Expanded property to true doesn't seem to work. I debugged it and CanExpand is still false (because the ChildItem is still null) at this time.
The HierarchyLoadMode is set to the default one (ServerOnDemand)
I found out that when the user clicks the expand button a firecommand method is called with "ExpandCollapse" and the
I have a RadGrid with a detailtable.
Given a certain condition i would like to expand an item dynamically usiong the following code
| protected void customerRadGrid_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| if (MyExpandCondition((e.Item as GridDataItem))) |
| { |
| item.Expanded = true; |
| } |
| } |
| } |
Just setting the Expanded property to true doesn't seem to work. I debugged it and CanExpand is still false (because the ChildItem is still null) at this time.
The HierarchyLoadMode is set to the default one (ServerOnDemand)
I found out that when the user clicks the expand button a firecommand method is called with "ExpandCollapse" and the
ItemIndexHierarchical
as parameters.
So i changed the "item.Expanded = true" line into "item.FireCommandEvent(RadGrid.ExpandCollapseCommandName, item.ItemIndexHierarchical)" but that doesn't seem to do what i expected.
Does anybody know how to expand this server-side? Or is there a Telerik demo that shows how to do this?
Thanks in advance!