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

Grid don't keep is data

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 14 Jun 2011, 06:56 PM
Hi

I have a really big problem. I have two grids on two differents windows. One grid must have a list of user and the other must be empty at his first load. Then, I select data in the first grid and I transfert it into the second grid. To do that, I'm using a dataSet in a singleton class. So, the first grid add the selected item in the dataSet and the seconds grid show what his in the dataSet. So far, so good. When I close the window that have the second grid (let's call it winGridB), the dataSet is clear and so, when the winGridB is open again, the grid is empty, like I wish. The problem come when I close the browser. Because I used the event onClientClose and this event doesn't seem to be call when I close the browser, the dataSet isn't clear. So, I when open the winGridB again, there are old data in it. To correct this problem, I try to clear the dataSet in the event Page_Load, OnLoad and OnInit, but it seem like those event are called each time the page is refresh. So, if I add data on the dataSet, the grid in the winGridB will be rebind to get the latest data and the page will be reload, which mean the dataSet will be clear. So, I'm stuck !!!

To resume, I'm using a dataSet with my grid and I don't know how to clear my dataSet when the browser is close. If anybody have a idea, just let me know.
Thank you

David 

2 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 20 Jun 2011, 07:30 AM
Hello David,

Have you tried using the onbeforeunload event of the page body to perform your clearing logic? I assume it should work for you in such scenario:
onbeforeunload Event

Kind regards,
Tsvetina
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.

0
David
Top achievements
Rank 1
answered on 20 Jun 2011, 02:05 PM
Hi,

Thank you, it work fine.
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
David
Top achievements
Rank 1
Share this question
or