因行根据条件进行了颜色区分,导致选择区域的默认颜色被覆盖,最后通过重新给单元格设置背景颜色解决,仅做记录,可能有更好的办法。
private void GridView1_RowCellStyle(object sender, RowCellStyleEventArgs e)
{
//鼠标多选选区颜色设置
GridView view = gridControl1.FocusedView as GridView;
GridCell[] gridCells = view.GetSelectedCells();
foreach (GridCell cell in gridCells)
{
if (e.Column.Name == cell.Column.Name && e.RowHandle == cell.RowHandle)
{
e.Appearance.BackColor = Color.FromArgb(188, 210, 238);
}
}
}