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
close icon

How to make the color of a cell gradiently change with is data-value?

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 : )

4 Replies

TR TrySyncfusion replied to TrySyncfusion July 11, 2016 08:41 AM UTC

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


VS Venkatesh Sundaram Syncfusion Team July 12, 2016 12:07 PM UTC

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. 



TR TrySyncfusion July 13, 2016 01:04 AM UTC

Thanks a lot:)


VS Venkatesh Sundaram Syncfusion Team July 13, 2016 05:53 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon