我的编码中有一个使用 C# 的 WinForm,我使用 gridcontrol Devexpress 2010 来显示数据联系人列表。
选择这些列表后,我从我选择的 gridcontrol 中获取值,然后按“确定”按钮获取它。我不知道代码。
任何人都可以推荐我。
最佳答案
首先,我建议您阅读知识库文章: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:
- Add a Boolean data column to your data source that will maintain the selected state of rows.
- 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
引用文献:
DevExpress Example:Multiple selection using checkbox (web style)
希望这有帮助..
关于c# - 如何使用 checkedit gridcontrol devexpress 选择行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29359705/