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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PushButton coloring

Thread ID:

Created:

Updated:

Platform:

Replies:

28889 May 12,2005 02:37 AM UTC May 12,2005 09:17 AM UTC Windows Forms 1
loading
Tags: GridControl
Eric Luk
Asked On May 12, 2005 02:37 AM UTC

Hi, How can I change the back color and text color for a cell with CellType="PushButton"? Thanks a lot! Eric

Administrator [Syncfusion]
Replied On May 12, 2005 09:17 AM UTC

You can try handling the DrawCellButtonBackground event.
private void gridControl1_DrawCellButtonBackground(object sender, GridDrawCellButtonBackgroundEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.RowIndex == 2 && cc.ColIndex == 3)
	{
		e.Graphics.FillRectangle(Brushes.Red, e.Bounds);
		e.Cancel = true;
	}
}

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

;