How to Select row using checkedit gridcontrol deve

2019-05-24 21:34发布

问题:

i have a winfrom using C# in my coding , and i use gridcontrol devexpress 2010 to show data contact list.

here is my form

after select those list i get the value from gridcontrol that i select and press button OK to get it. I don't know the code.

anyone can suggest me,....thanks

回答1:

First of all i suggest you to the KB article: How to select rows via an unbound checkbox column

Starting with version 13.2, the GridView in the XtraGrid control provides a built-in checkbox column for multiple row selection. See the following help topic to learn more: Multiple Row Selection via Built-In Check Column

In versions prior to 13.2, you can use the following two methods to manually implement a column for row selection:

  1. Add a Boolean data column to your data source that will maintain the selected state of rows.
  2. Use an unbound grid column.

The first approach is easy to implement, but adding "dummy" columns to data is often forbidden due to the constraints of an application's business logic.

The second approach is clarified below.

Create an array that will store the selected states of rows. Create an Unbound Column whose values will be in sync with the array. Write a CustomUnboundColumnData event handler to get/set unbound column values.
See perfect example of this here:
DevExpress XtraGrid Control with checkBoxEdit column

References:
DevExpress Example:Multiple selection using checkbox (web style)

Hope this help..