Hi,
I'm trying to hide the expand/collpase images on rows that do not have nested data. I've tried to follow the advice in your help doc:
ms-help://telerik.aspnetajax.radcontrols.2008.Q2/telerik.aspnetajax.radgrid.2008.Q2/hide-expand-collapse-images-when-no-records-in-self-referencing-hierarchy.html
However, it doesn't work for me, perhaps because I'm using the <NestedViewTemplate> approach to build the nested data? Your example uses the PreRender event to hide the expand/collapse. Following your other example of how to do the manual <NestedViewTemplate> approach, I'm already building the nested HTML in the PreRender event already with code similar to this:
Since I'm already looping through the NestedView collection it seems like it should be easy to get to the expand/collapse cell, but after trying many different ways to access it in the object model I'm lost. So my question is how to get to the parent row's expand/collapse cell when I have a GridNestedViewItem object.
Also, I prefer to keep using HierarchyLoadMode="Client" to avoid post-backs if possible.
Thank you,
Terry
I'm trying to hide the expand/collpase images on rows that do not have nested data. I've tried to follow the advice in your help doc:
ms-help://telerik.aspnetajax.radcontrols.2008.Q2/telerik.aspnetajax.radgrid.2008.Q2/hide-expand-collapse-images-when-no-records-in-self-referencing-hierarchy.html
However, it doesn't work for me, perhaps because I'm using the <NestedViewTemplate> approach to build the nested data? Your example uses the PreRender event to hide the expand/collapse. Following your other example of how to do the manual <NestedViewTemplate> approach, I'm already building the nested HTML in the PreRender event already with code similar to this:
Protected Sub grid_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grid.PreRender |
Dim items As Telerik.Web.UI.GridItem() = grid.MasterTableView.GetItems(Telerik.Web.UI.GridItemType.NestedView) |
For Each item As Telerik.Web.UI.GridNestedViewItem In items |
'Customize the NestedViewTemplate. |
Dim myData As MyDataObject = DirectCast(item.DataItem, MyDataObject) |
Dim nestedTable As Table = item.FindControl("nestedTable") |
...Build the nested HTML |
Next |
End Sub |
Since I'm already looping through the NestedView collection it seems like it should be easy to get to the expand/collapse cell, but after trying many different ways to access it in the object model I'm lost. So my question is how to get to the parent row's expand/collapse cell when I have a GridNestedViewItem object.
Also, I prefer to keep using HierarchyLoadMode="Client" to avoid post-backs if possible.
Thank you,
Terry