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

Styles lost after ajax

3 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karthik
Top achievements
Rank 1
Karthik asked on 27 Apr 2012, 01:54 PM
Hi,

I have an ajaxified hierarchical RadGrid implemented statically with load on demand. I control the details table display settings from javascript.
The issue is : when I change the details table display from client and later perform any ajax operation the detail table display settings updated using javascript are lost. Is there any way where I can prevent this ?

Thanks,
Karthik 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 May 2012, 03:01 PM
Hello Karthik,

Please note that any client-side change made to a given control will be lost if not saved accordingly either on the server or on the ViewState. This is a general issue for all data bind controls and it is not specific only to RadGrid.

One possible way to preserve your desired modifications is to apply them every time the control loads, for example on Page_Load or OnGridCreated client event of RadGrid. 

However, please note that in ServerOnDemand mode, only the detail table-views of the expanded items are rendered, therefore you will be able to access just the visible items.

It would be best if you share with us what you want to achieve in your project. Thus we will be able to advice you a more appropriate solution to achieve your preferred scenario.

Regards,
Eyup
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.
0
Karthik
Top achievements
Rank 1
answered on 14 May 2012, 09:49 AM
Hello Eyup,

Thanks for the information. As per you requested I am giving you a brief description of what I am trying to do. I am trying to generate a RadGrid based on some criteria chosen by the user. Initially when the page loads I don't load the grid. I generate the Grid on submit after the user selects what he needs. In this case I am unable to maintain the changes which I do on client after loading any other detail table.
   It would be better if you could suggest a better way of generating the Grid on submit.

Thanks,
Karthik
0
Eyup
Telerik team
answered on 17 May 2012, 07:47 AM
Hi Karthik,

As I explained in my previous post, you will need to generate your grid on server side to preserve its state. One possible approach is to load the entire grid on initial page load, but set its visibility to false. Therefore, according to given user's preferences you will be able to gradually show up the regarding table view with server side settings.
If you insist on loading the grid on client-side command, you will need to register your javascript declaration on the Page, which is demonstrated in the following article:
Execute Custom Javascript

Regards,
Eyup
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
Karthik
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Karthik
Top achievements
Rank 1
Share this question
or