Thank you. That works. But I've got another problem with row selection. See attached picture.
Here is code which I use for row selection:
private void OnPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
Record record = this.GridControl.Table.CurrentRecord;
object dataItem = GetDataItem(record == null ? (object)null : record.GetData());
GridCurrentCell cc = this.GridControl.TableControl.CurrentCell;
GridControlBase grid = this.GridControl.TableControl.CurrentCell.Grid;
if (dataItem != null && e.Inner.RowIndex > grid.Model.Rows.HeaderCount &&
e.Inner.ColIndex > grid.Model.Cols.HeaderCount && cc.HasCurrentCellAt(e.Inner.RowIndex))
{
if (e.Inner.ColIndex == cc.ColIndex)
{
if (cc.IsEditing)
{
e.Inner.Style.Interior = new Syncfusion.Drawing.BrushInfo(SystemColors.Window);
}
else
{
e.Inner.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.RoyalBlue);
}
}
else
{
if (e.Inner.Style.Interior.BackColor == GridControl.BackColor)
{
e.Inner.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.CornflowerBlue);
}
else
{
int resultColor = AlphaBlendRGB(e.Inner.Style.Interior.BackColor.ToArgb(),
Color.CornflowerBlue.ToArgb(), 153);
e.Inner.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.FromArgb(resultColor));
}
}
e.Inner.Style.TextColor = cc.IsEditing ? SystemColors.WindowText : SystemColors.HighlightText;
e.Inner.Style.Font.Bold = cc.IsEditing ? false : true;
}
}
private static int AlphaBlendRGB(int src, int bg, byte alpha)
{
uint rb = (uint)((((src & 0x00ff00ff) * alpha) + ((bg & 0x00ff00ff) * (0xff - alpha))) & 0xff00ff00);
uint g = (uint)((((src & 0x0000ff00) * alpha) + ((bg & 0x0000ff00) * (0xff - alpha))) & 0x00ff0000);
return (int)((src & 0xff000000) | ((rb | g) >> 8) + 0x00010101);
}
Selector_ca1b5695.rar