GridView Multi Select ?

B

brianpmccullough

hello,

I have just started playing with the GridView (Web Forms) control in ASP.NET
2.0. I have an application that I would like to use the GridView to select
multiple rows by simply clicking on the row, much like you can with a ListBox.

First of all, is MultiSelect possible in the GridView control?

Is there a way to get it to allow selection of a whole row by simply
clicking on the row (similar to a listbox control)?

Thanks!

-Brian
 
P

Phillip Williams

Hi Brian,

1- The GridView documentation only mention selectedRow attribute which
returns a reference to a single row:
http://msdn2.microsoft.com/en-us/library/y5cktw3x(en-US,VS.80).aspx

2- Regarding your second question, search for a topic named "GridView whole
row select" that we discussed on this forum on Nov 29, where a Select
CommandField was created with a style that has display=none and a Javascript
added during the RowDataBound event simulate a click of the select button.

Another alternative, but a bit more involved, is to take control of saving
indicators to the selected rows in <input type="hidden"> object on the
webpage that you retrieve in the codebehind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top