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

Changing style of grid

Thread ID:

Created:

Updated:

Platform:

Replies:

124230 May 25,2016 03:30 PM UTC May 26,2016 06:47 AM UTC Windows Forms 1
loading
Tags: PivotGridControl
Chris Bishop
Asked On May 25, 2016 03:30 PM UTC

Hi,

I would like to change the background colors of the pivot grid.  I tried modifying the base style maps but only Standard seemed to be affected.  I cannot change the color of the Row / Column headers.
How would I go about customizing the pivot grid?

Neelakandan Kannan [Syncfusion]
Replied On May 26, 2016 06:47 AM UTC

Hi Chris, 

Thanks for using Syncfusion products. 

If you want to change the color of the headers or any cells in the PivotGridControl, you can use the QueryCellInfo event of the TableModel. The cell type can be checked by using CellType property. Please make use of below code, 

Code Snippet: 
//Trigerring the event. 
this.pivotGridControl1.TableModel.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(TableModel_QueryCellInfo); 
 
void TableModel_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e) 
{ 
//Checking the header cells. 
if (e.Style.CellType == "PivotGridHeaderCell") 
{ 
e.Style.Themed = false; 
e.Style.BackColor = Color.LightPink; 
} 
 
//Checking the total value cells. 
if (e.Style.CellType == "PivotGridTotalValueCell") 
{ 
e.Style.BackColor = Color.LightGreen; 
} 
 
} 
 
Sample 
 
Regards, 
Neelakandan 


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

;