set color currentcell

Hello, I''m not able to understand how can I set the color (background) of the cell currently selected. Someone can help me? Many thanks Nick

1 Reply

AD Administrator Syncfusion Team May 11, 2005 08:39 PM UTC

Try setting the backcolor of the currentcell by handling the PrepareViewStyleInfo event, and if the eventargs point to the currentcell, set the e.Style.Backcolor property.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(e.RowIndex == cc.RowIndex && e.ColIndex == cc.ColIndex)
		e.Style.BackColor = Color.Red;
}

Loader.
Up arrow icon