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

cell textbox backcolor

I am alternating row colors in a GridControl by setting the style.Interior property in the PrepareViewStyleInfo event. However, when a in-cell textbox becomes active, the backcolor of the text box is the same as the row backcolor when I'd like it be SystemColor.Window, like all other textboxes normally are. How can I do this? Terry

1 Reply

AD Administrator Syncfusion Team August 5, 2003 09:45 PM UTC

You can try setting the backcolor in the CurrentCell in PrepareViewStyleInfo.
private void gridControl1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
	if((e.RowIndex % 2) == 1)
		e.Style.BackColor = Color.LightGoldenrodYellow;

	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.RowIndex == e.RowIndex && cc.ColIndex == e.ColIndex)
	{
		e.Style.BackColor = Color.White;
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon