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.

How can I change a row color by a data value

Thread ID:

Created:

Updated:

Platform:

Replies:

32909 Aug 10,2005 12:10 AM Oct 6,2005 10:09 AM Windows Forms 3
loading
Tags: FAQ
Suite
Asked On August 10, 2005 12:10 AM

I want to change a row color to red when a data value == 1. How can I do that in datagrid in C# winForm?

SiD
Replied On October 6, 2005 10:09 AM

Override the paint method. Object o = this.DataGridTableStyle.DataGrid[rowNum,]; int chk = Convert.ToInt32(o); if(chk == 1) { foreBrush = new SolidBrush(Color.Blue); }

SiD
Replied On October 6, 2005 10:09 AM

Override the paint method. Object o = this.DataGridTableStyle.DataGrid[rowNum,]; int chk = Convert.ToInt32(o); if(chk == 1) { foreBrush = new SolidBrush(Color.Blue); }

SiD
Replied On October 6, 2005 10:09 AM

Override the paint method. Object o = this.DataGridTableStyle.DataGrid[rowNum,]; int chk = Convert.ToInt32(o); if(chk == 1) { foreBrush = new SolidBrush(Color.Blue); } >I want to change a row color to red when a data value == 1. >How can I do that in datagrid in C# winForm?

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.

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.

;