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

Use of GridClientSelectColumn and then move data

5 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jesús
Top achievements
Rank 1
Jesús asked on 26 May 2011, 05:21 PM
Hi.

I have a grid with some data (registers) with a GridClientSelectColumn.

When I have selected the desired registers I have I use the following function to access to the selected data:

function GetSelectedItems() {
    elems = $find("<%= leftGrid.MasterTableView.ClientID %>").get_selectedItemss();
}

At this point, I want to make an AJAX call for move the selected registers to another place (like another grid) or make some INSERTs into a concrete table at a database.

How can I get the selected rows to pass them to the server-side?

Best regards

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 May 2011, 07:32 AM
Hello,

You can access the selected rows from server side like below.
C#:
foreach (GridDataItem selectedItem in RadGrid1.SelectedItems)
  {
         //your code goes here
  }

When you are selecting row from client side, it won't persist after PostBack. You can  try the following approach to persist the selected row, which is selected from client side. Please review the following help article.
Persisting the selected rows client-side on sorting/paging/filtering/grouping.

Thanks,
Shinu.
0
Jesús
Top achievements
Rank 1
answered on 27 May 2011, 09:46 AM
At server side, RadGrid1.SelectedItems is returning null, even thought I've selected all the items at server side.
0
Pavlina
Telerik team
answered on 27 May 2011, 10:09 AM
Hello,

Go through the link below and see if it helps:
http://www.telerik.com/community/forums/aspnet/grid/radgrid1-selecteditems-0-is-always-null.aspx

Best wishes,
Pavlina
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
Jesús
Top achievements
Rank 1
answered on 27 May 2011, 12:51 PM
My trouble is we have a grid we need to select some data (in some cases, all data, and it can be thousands on registers) and the do something with this data. When the number of registers starts to be a little big, I'm trying to discover the best way to do this, the data selection and the things we have to do when the data is selected.

What can I do to have the change to select the data "fastly" and then do something with these data? I think do something with these data have to be done at server side, but if I select at client-side I don't succeed to see (and get) this selection and server side.

Or you need a support ticket for this?
0
Accepted
Pavlina
Telerik team
answered on 30 May 2011, 12:00 PM
Hello,

I hope that the code library below which elaborates on client side toggle selection with server side persisting of the selected items will help you to achieve the desired functionality:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/radgrid-client-side-toggle-selection-with-server-side-persisting-of-the-selected-items-after-sorting-filtering-and-paging.aspx

Best wishes,
Pavlina
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.

Tags
Grid
Asked by
Jesús
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jesús
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or