DevExpress GridControl gridView明细多选

时间:2024-03-15 20:45:20

一、这样设置后,明细行按Ctrl ,鼠标可连续多选,间接多选

gridView1 .OptionsSelection.MultiSelect = true;

gridView1 .OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;

 

二、GridContorl显示chekbox

设置MultiSelectMode = CheckBoxRowSelect;

MultiSelect = True;

DevExpress GridControl gridView明细多选

 

三、获取checkBox选中行

   int[] rownumber = this.gridView1.GetSelectedRows();//获取选中行号;

   DataRow row =    this.gridView1.GetDataRow(rownumber[0]);//根据行号获取相应行的数据;