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

Access Row of Clientside bound grid on serverside

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prathibarani
Top achievements
Rank 1
Prathibarani asked on 31 May 2018, 07:17 PM

Hi,

We are binding RadGrid on Client using RadClientDataSource. The grid has template columns with links. When link is clicked, we want itemcommand event to get fired on server side. Here we want to access row data and manipulate data. Since it is clientbound, we are not able to access row data. What is the best way to take care of it so that entire row data is available to us on server side.

We used to bind the grid on server side. It was very slow. So, we switched to clientside binding which is very fast. But lot of logic happens on server side.

I can use hidden fields and on client get values and use them. We are trying to avoid it because we use this grid on many pages and trying to come up with global solution.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 05 Jun 2018, 12:12 PM
Hi Prathibarani,

When the grid is bound on client-side, it is not possible to access this data on server-side because the data is present on the client. However, you can fire a custom command using the fireCommand method and pass a string argument holding the row data, e.g. in JSON format:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/methods/firecommand

You can check how to stringify JSON and pass it on server-side, then extract it on the code-behind in the RadGridGetAllSelectedItemsImproved.zip sample provided here:
https://www.telerik.com/support/code-library/get-selected-items-through-all-pages#1eTU8nr-GUG8zfGgOGbIcA

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Prathibarani
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or