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

Lost NestedView On Data Rebind

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 18 Dec 2012, 05:54 PM
I have a RADGrid (inherited) that I am manipulating using Server-Side code. When I first initialize the grid, I add a NestedViewTemplate that I designed to the grid. When the page loads, the grid appears perfectly fine. Inside the grid rows, I have an ImageButton that when pressed, updates the DataBoundItem, and then refreshs the grid with the new information. When the grid refreshes, the NestedViewTemplate vanishes.

I've tried RADGrid.DataBind() as well as RADGrid.Rebind().  In both cases I check if RADGrid.MasterTableView.NestedViewTemplate is empty...if it is, I re-add the NestedViewTemplate before the "DataBind". I see that the ItemCreated() method runs, and it does create a "GridNestedViewItem"...but when the process is complete, the NestedView doesn't appear. I have to completely re-load the page to get the NestedView to re-appear.

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 21 Dec 2012, 02:55 PM
Hello Ben,

I'm not sure that I completely understand your scenario. If you are creating the grid entirely in the code behind you should do so in the Page_Init event handler. This is done in order to persist the changes in the ViewState. I suggest that you take a look at this help article where programmatic creation is thoroughly explained. If this is not the case please elaborate more on your scenario so we could give you a more precise answer.

All the best,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or