We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

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.
Live Chat Icon For mobile
Up arrow icon