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

Grid Multiple Select Client > Server

3 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jwhitley
Top achievements
Rank 1
jwhitley asked on 08 Aug 2011, 05:27 PM
I implemented an Outlook Web Access type mailbox using RadGrid eons ago and have only had to perform minor maintenance over the years. It is currently using Q1 2011 controls and has been limited to single row selections. I capture the client side rowclick event and perform a callback to the server passing the newly selected index as an argument. Server side I reset the colour of the previously selected row (grid.SelectedItems[0]) and unselect it, then darken the colour of the newly selected row (the index of which was passed as an argument in the callback), selecting it server side.

My client now wants to enable multirow select (to delete multiple emails, for example). I would of course like to do this with as few changes as possible, but during the callback, the server does not know whether the newly selected row is part of a multiple selection or a single selection, so it does not know whether the previously selected row needs to be unselected or not. Is there any argument that I can pass to the server as part of the callback which indicates whether the ctrl key was depressed at the time of the new selection (or, even better, an attribute of the grid that shows which is the current selection "mode")? If not, what's the best way of reading all selected row indexes client side so that I can pass an argument array to the server?

Many thanks.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Aug 2011, 05:43 PM
Hi Jwhitley,

I suggest that you check out the code library below and see if it helps to achieve your goal:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/how-to-select-multiple-items-without-holding-the-ctrl-key.aspx

Kind regards,
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
jwhitley
Top achievements
Rank 1
answered on 18 Aug 2011, 11:55 AM
Thanks for the reply. Having to hold down the control key is not a problem. The issue is providing a list of all currently selected row indexes to the server during the callback. For a single row this is easy as the rowclick event on the client includes the row index and I can pass this as an argument to the server. What I can't seem to get hold of on the client is an array of all selected row indexes. I can get the row objects themselves, but can't seem to access the indexes.

I'm hoping this is easy to achieve?

Thanks again.
0
Pavlina
Telerik team
answered on 24 Aug 2011, 10:01 AM
Hello Jwhitley,

Go through the link below and see if it helps:
http://www.telerik.com/community/forums/aspnet/grid/multiselect-rows-from-client-to-server.aspx

Best wishes,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
jwhitley
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
jwhitley
Top achievements
Rank 1
Share this question
or