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

Grid with EditForm containing Grid with EditForm

1 Answer 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 14 Dec 2010, 07:09 PM
Hello -

I am encountering an issue with a grid inside an EditForm for a parent grid that I cannot seem to correct.

When I choose to edit a row in the parent grid the form comes up and I am able to modify the fields placed directly on the form. On that same form is another grid that also has an edit form that needs to be completed. When I click to add/edit the child grid it simply flashes and the editform does not appear.

I tracked this down to code that I have in the PreRender event for the parent grid to change the editcolumn text from "Edit" to "View" depending on the users selection and then rebind the grid. This event fires when I click the add/edit in the child grid and prevents the form from appearing. If I remove the rebind from the prerender event for the parent the text for the editcolumn no longer changes and the child grid no longer shows any data but the editform does appear when add/edit is selected. Additionally, when I do click the add/edit button and the form comes up, all of the rows that should have been shown the first time also appear.

Is there a way to get around the rebind in prerender so that I can swap the text for the editcolumn?

How can I refresh the child grid to show the records when it is rendered and keep them showing?

Any assistance is greatly appreciated!

Thanks,
Shawn

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 20 Dec 2010, 12:31 PM
Hi Shawn,

Indeed, your observations are right. Rebinding the parent grid on each PreRender invokes recreation of the inner grid and that is why its edit command is not fired as expected. You can try changing the Edit link text in the ItemDataBound/ItemCreated event of the parent grid instead.
Check it out and let me know if this works for you.

Regards,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Shawn
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or