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

[Solved] Grid losing data on postback triggered from controls inside the grid

3 Answers 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ForestC
Top achievements
Rank 1
ForestC asked on 04 Mar 2010, 05:49 PM
I have a RadGrid that is bound to a DataSet. On each row I have GridTemplateColumns with a LinkButton with the CommandName "Delete".

When clicking the link, the grid posts back data with Ajax and I expect it to catch the click event.

However, when buttons are placed inside the grid, the first event on postback is not the ItemCreated-event, instead the first event is PageLoad. It doesn't look like the grid fires the event sequence described here:
http://www.telerik.com/help/aspnet-ajax/grdeventsequence.html

If I trigger a postback with controls that are positioned outside the grid, the sequence is fired as expected with the ItemCreated event executed first.

It seems that all rows in the grid are lost during postback. Any ideas about how to track this problem down?

Thanks,
Martin

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 09 Mar 2010, 08:14 AM
Hi ForestC,

If you bind the RadGrid into the NeedDataSource event handler could you please verify that you have not set the RadGrid's AllowAutomaticDeletes property to true?

Also it is hard to say what is causing this problem without seeing some code. Could you please post your gird declaration and the code behind, or open a support ticket and send us a small runnable project which demonstrates the described issue.

Sincerely yours,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
ForestC
Top achievements
Rank 1
answered on 09 Mar 2010, 10:33 AM
Hi,
Thanks for your reply.

After further investigation, I've found that this problem depends on other controls placed on the page. If I place the grid inside a Tab Strip that is placed inside a Sliding Pane at the same time as I have another RadGrid placed inside one of the other panes, this issue surfaces.

If I move them to different pages, the problem goes away. There are no dependencies between the two grids, they don't have similar Ids etc, and it doesn't matter if Ajax is enabled or not.

I have managed to come around this problem by loading the controls dynamically. If I do so, the problem goes away.

Unfortunately, I don't have an example project to attach, since the project is quite large and database bound.

Rgds
Martin
0
Radoslav
Telerik team
answered on 11 Mar 2010, 03:24 PM
Hello ForestC,

I understand that your project is big and it is complicated, however you could send us a small piece of it. To recreate a problem in small project is not as hard as it looks. You could send us several files which are connected to a page in which the exceptions are thrown.  If you have worries about sending us the database you could create a small database which contains only several tables from the real database. If we have the project we will be able to gather more details about your scenario and provide you with more to-the-point answer.

Regards,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
ForestC
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
ForestC
Top achievements
Rank 1
Share this question
or