Devexpress GridControl 多选

以前dev的多选要自己处理,一般的处理方式就是在单元格中添加checkbox控件。后来的版本中dev增加了多选的支持,只需要设置一下属性就可以了,属性如下图:

然后效果设计页面就是这个样子:

运行以后是这个样子:

下面的代码演示如何获取勾选的行:

foreach (var handle in this.gridViewAttachment.GetSelectedRows())
{
var att = this.gridViewAttachment.GetRow(handle) as Attachment;
if (att == null)
{
continue;
}
FilePathNeedToDel.Add(att.f_Path);
}
this.gridViewAttachment.DeleteSelectedRows();

  

原文地址:https://www.cnblogs.com/yuanjiedao/p/7988252.html