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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

cell textbox backcolor

Thread ID:

Created:

Updated:

Platform:

Replies:

6225 Aug 5,2003 04:47 PM UTC Aug 5,2003 09:45 PM UTC WinForms 1
loading
Tags: GridControl
Terry Foster
Asked On August 5, 2003 04:47 PM UTC

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

Administrator [Syncfusion]
Replied On 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;
	}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;