鸳孑刀

导航

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();

 

  

 

posted on 2017-12-05 17:14  街西  阅读(328)  评论(0编辑  收藏  举报