Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Loosing NestedViewTemplate On Page Index Change

$
0
0

I created my own CompositeControl that extends and automates many tasks for me with the RADGrid. Posting the code in it's entirety is impossible because of how complex it is. But I am going to do my best to explain the gist of my problem and what I am  looking for.

I use the RADGrid almost entirely using Server-Side code (VB.Net flavor). Now ad the time I initialize my grid (at page load) I add a custom Template to the MasterTableView.NestedViewTemplate. The custom template is a class I created inheriting from ITemplate and implements the InstantiateIn method. I set the MasterTableView.HierarchyLoadMode = Client as well. The template I created simply displays additional fields on the same parent record (ie: row) that I manually have hidden from the RADGrid column list (for lack of space). If the user wants to see the additional information, expanding the nested view will show them the remaining fields.

The first time my page/grid load...works perfectly, the arrow appears on the left side of each record and if clicks it expands to show my custom NestedViewTemplate. However the problem I have is that I am also sometimes allowing for paging, and if the user changes the page I lose the NestedViewTemplate completely. The arrows to the left of each row vanish.

I have saved the ITemplate class into the ViewState so that I can "reattach" it if it is found to be missing at a later reload. I have looked all around to see at which point I need to reattach it, but no matter where I re-attach the NestedViewTemplate, it doesn't re-appear on a page index change.

My question is, at which event should I be re-attaching the NestedViewTemplate so that it is early enough in the event timeline that it can bind with the parent data and display on the RADGrid? I've tried Page_Init, Page_Load, and grid_DataBinding...no luck. When stepping through my code, I see that at the time that the PageIndex is changed, the NestedViewTemplate is loaded into the RADGrid. The only thing I noticed that is different is that in the initial load of the grid, the gridDataBinding() event is fired, but when the page index is changed it does not fire.

HELP!


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>