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

Serialize Grid (Client Side)

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Søren Hartig
Top achievements
Rank 2
Søren Hartig asked on 14 Jun 2010, 06:17 PM
Is it possible to serialize a RadGrid and then use it as a control in the server side?

client side:

var grid = $find('<%= gvQuery.ClientID %>');
$.get("asynchronous/getSearchResults.ashx", { "grid": grid }, function(data) {
  // use data
});

and in the getSearchResults.ashx Handler:

RadGrid grid = (RadGrid)context.Request["grid"];


what do I need to set to use the RadGrid like this? so I can separate the process of searching for a result and give a fancy smooth experience to the user without wasting to much bandwidth.

The second attempt would be go row by row and create a JSON from the selected items, but this is a little bit overkill as I need to create hidden fields for each row and set them correctly (client-side) per each type of search the user selects... per row...

Thank you.

2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 17 Jun 2010, 09:22 AM
Hi Søren,

RadGrid does not support this type of serialization of the client object and deserializing it on the server. Its items are recreated on the server on postback (with server-side databinding), so no need to serialize item data from the client. Client selection is also persisted on the server, so you have the SelectedItems both on the client and the server.

If you tell us your exact scenario and what you need to implement, we might be able to suggest a better approach.

Kind regards,
Veli
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
Søren Hartig
Top achievements
Rank 2
answered on 17 Jun 2010, 01:21 PM
I will have to rethink everything then...

I will ask for support or enter my question here if I get any block in the road.

Thank you for the time to answer me.
Tags
Grid
Asked by
Søren Hartig
Top achievements
Rank 2
Answers by
Veli
Telerik team
Søren Hartig
Top achievements
Rank 2
Share this question
or