DotNetBar使用技巧之SuperGridControl鼠标左键滑动选中


SuperGridControl与DataGirdViewEx不同,在SuperGridControl的CellMouseEnter事件中没有捕获鼠标的属性,需要自行判断鼠标属性

 private void GridDrug_CellMouseEnter(object sender, GridCellEventArgs e)
        {
            if (e.GridCell.ColumnIndex == colSelect.ColumnIndex && Control.MouseButtons == MouseButtons.Left)//colSelect为选择框所在列
            {
                e.GridCell.GridRow.Checked = !e.GridCell.GridRow.Checked;
            }
        }