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

How to use an unbound check box column to select grid rows

$
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 example that targets version 13.2. Additional information can be found in the following topic: Multiple Row Selection via Built-In Check Column

If you are using an earlier version of DevExpress controls, see the attached example that targets this earlier version.
This example demonstrates a method to manually create a check column for row selection. The example is similar to the one from the A371 article. The difference is that this example employs the grid's built-in multi-selection and keeps it in sync with the check boxes. All code related to selection is placed into the GridCheckMarksSelection helper class, so it should be easy to port this functionality to your application.
Please note if you use the AppearanceEvenRow and AppearanceOddRow styles, by default they have a higher priority than the RowStyle event used for the selection in this example. To avoid drawing incorrect selected rows, enable the e.HighPriority option. See Also: E1271

Question Comments

Added By: Marco Villasesr at: 2/2/2014 8:31:14 AM    

Could you please attach a sample Project, please? thank you!!

Added By: david ola at: 12/17/2015 5:18:30 AM    

How do you respond to the selection change event? I needed to populate another grid based on the number of rows selected in my gridcontrol. Everything works well until no rows were selected. At that time, the SelectionChange event did not work. The other grid should be cleared when selectionCount become zero in my original gridcontrol, but it still displays the contents as if SelectionCount =1.
Is that a bug?

Added By: Nadezhda (DevExpress Support) at: 12/17/2015 12:43:08 PM    

Hello,

Before I suggest a solution, I need to know which approach you use. Do you utilize the GridCheckMarksSelection helper class or the CheckBoxRowSelect select mode?

I look forward to hearing from you.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



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