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.

Question Comments

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

Hmmm how do I use this class ?

Added By: You Logic at: 10/16/2012 4: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 4:13:11 AM    

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

Added By: (no info) at: 11/25/2013 2: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.

Added By: Dave Smith 6 at: 3/4/2016 2:15:24 AM    After implementing this class the column does not show, not sure what I'm doing wrong.

In the constructor of my form  I call  new GridCheckMarksSelection(gridViewSearchInventory);

and then in the form load i bind to my grid Added By: Sasha (DevExpress Support) at: 3/4/2016 6:20:43 AM    

Hello Dave,
I've created a separate ticket on your behalf: GridControl - The check box column is not shown when using a class from the E1271: Multiple selection using checkbox (web style) example .
We will update it shortly.

Added By: Jacobo Amselem at: 4/14/2016 3:35:49 AM    Hello
How can I modify View_Click() to invert group row selection when clicking the group checkbox ONLY?
Current implementation inverts selection when clicking anywhere in the group row.

Thank you Added By: Alisher (DevExpress Support) at: 4/14/2016 5:05:29 AM    

Hello,

I've created a separate ticket on your behalf (T367815: How to invert group row selection when clicking the group checkbox only?). It has been placed in our processing queue and will be answered shortly.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



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