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 to make the color of a cell gradiently change with is data-value?

Thread ID:

Created:

Updated:

Platform:

Replies:

124956 Jul 11,2016 04:32 AM Jul 13,2016 01:53 AM Windows Forms 4
loading
Tags: GridGroupingControl
TrySyncfusion
Asked On July 11, 2016 04:32 AM

Hi,

I'm working with the GridGroupControl right now, and I need to let the back-color of a cell  gradiently change with is data-value. How can I implement this ?
Thanks : )

TrySyncfusion
Replied On July 11, 2016 04:41 AM

Hi,

I'm working with the GridGroupControl right now, and I need to let the back-color of a cell  gradiently change with is data-value. How can I implement this ?
Thanks : )

 sorry, with is data-value --> with its data-value

Venkatesh Sundaram [Syncfusion]
Replied On July 12, 2016 08:07 AM

Dear Customer,  
Thanks for your interest in Syncfusion products.  
The cell specific properties like BackColor (other than CellValue or Text) cannot be set using an indexer. In GridGroupingControl, the only data storage is the bound datasource which holds a single value. It does not hold TextColor, or Backcolor, or any of the other many cell specific properties. In order to set cell specific properties in the GridGroupingControl, you have to handle QueryCellStyleInfo event handler. 
Please refer to the following code example.  
//QueryCellStyleInfo event 
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) 
{   
if (e.TableCellIdentity.ColIndex == 5 && e.TableCellIdentity.RowIndex > 3) 
{ 
  if (int.Parse(e.Style.Text) > 75) 
    e.Style.BackColor = Color.Blue; 
  else 
    e.Style.BackColor = Color.Pink; 
  }    
} 
 
Regards,  
Venkat. 


TrySyncfusion
Replied On July 12, 2016 09:04 PM

Thanks a lot:)

Venkatesh Sundaram [Syncfusion]
Replied On July 13, 2016 01:53 AM

Dear Customer, 
 
Thanks for the update. Please let us know if you need any further assistance. 
 
Regards, 
Venkat. 


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.

;