Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

Multiple selection using checkbox (web style)

$
0
0

From version 13.2, the GridView in the XtraGrid control provides a built-in checkbox column for multiple row selection.

This feature is demonstrated in the following example: How to use an unbound check box column to select grid rows. Additional information can be found in the following topic: Multiple Row Selection via Built-In Check Column


Projects attached to the current article target earlier versions of DevExpress controls, which did not provide the built-in checkbox column for multiple row selection.
These examples show how to manually add a check column to allow web-style multiple row selection. End-users can select/deselect rows, group rows or select/deselect all rows by clicking the column header. Changing a check box value does not initiate row editing. These examples are based on the A371 article.

Example Comments

Added By: Marc Roussel at: 10/11/2012 8:59:00 AM    

Hmmm how do I use this class ?

Added By: You Logic at: 10/16/2012 7:16:54 AM    

When I select a row via code, the check box is not checked. How can I do this!?

Added By: Piotr Christ at: 2/8/2013 7:13:11 AM    

I had the same problem as You Logic ! How select row (with checkbox) from code ?

Added By: at: 11/25/2013 5:23:24 PM    

While this is a very nice implementation there is a problem with the code. Because you have defined selection *in the CheckMarkSelection.cs" as an ArrayList it is next to impossible to get at any values contained within each of the actual selected rows from the grid. Let's say one needs to obtain two of the values within the row...one is a string and one is an integer...how do you get the values out? There are no extension methods associated with "selection" that would allow you to enumerate the data lets say using linq or even simply doing somethin like: DataRowView theRow = (DataRowView)this.selection.GetSelectedRow(i); What happens is there is a cast error that occurs due to the generic types within the ArrayList. Granted this is necessary as we have an unknown group of column objects and values. There needs to be a built in method to access the individual values in the selected rows from "selection". I have tried 12 different methods to extract them and still a Cast error occurs.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>