![]() |
GridView Multi Select ?
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 |
RE: GridView Multi Select ?
Hi Brian,
1- The GridView documentation only mention selectedRow attribute which returns a reference to a single row: http://msdn2.microsoft.com/en-us/lib...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. -- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com "brianpmccullough" wrote: > 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 |
RE: GridView Multi Select ?
One more idea to implement a MultiSelect GridView is to add a
<asp:CheckBoxField > column as I did in this sample with the DataGrid: http://www.societopia.net/Samples/Da...olsEvents.aspx -- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com "Phillip Williams" wrote: > Hi Brian, > > 1- The GridView documentation only mention selectedRow attribute which > returns a reference to a single row: > http://msdn2.microsoft.com/en-us/lib...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. > -- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "brianpmccullough" wrote: > > > 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 |
RE: GridView Multi Select ?
I just placed a demo for a GridView where you can select multiple rows:
http://www.webswapp.com/CodeSamples/...ltiSelect.aspx -- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com "Phillip Williams" wrote: > Hi Brian, > > 1- The GridView documentation only mention selectedRow attribute which > returns a reference to a single row: > http://msdn2.microsoft.com/en-us/lib...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. > -- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "brianpmccullough" wrote: > > > 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 |
| All times are GMT. The time now is 06:54 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.