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

Changing background color of selected cells in pivotview


I use a Angular / Javascript pivotview with multiple cells selection enabled. 

How can i changed the background color of the selected cells ?

     this.pivotGridObj.gridSettings.allowSelection = true;
     this.pivotGridObj.gridSettings.selectionSettings =      { mode: 'Cell', cellSelectionMode: 'Flow', type: 'Multiple' }

I tried to access the grid object directly, but this is always undefined.

  if (this.pivotGridObj.grid !== undefined)
          this.pivotGridObj.grid.queryCellInfo = this.customiseCell;

 customiseCell(args: QueryCellInfoEventArgs) {
     // herefiltering for selected cells only 

3 Replies

SN Sivamathi Natarajan Syncfusion Team February 11, 2020 03:33 AM

Thanks for contacting Syncfusion support. 
You can change the background-color of the selected cells in CSS. Kindly check the below code example. 
Code Example: 
 .e-cellselectionbackground,.e-selectionbackground,.e-pivotview .e-grid .e-rowsheader.e-selectionbackground,.e-pivotview .e-grid .e-columnsheader.e-selectionbackground { 
              background-color: greenYellow !important; 
Meanwhile, we have prepared a sample for your reference. Kindly check the below sample link for your reference.  
We hope the above sample meets your requirement. 

RA Rainer February 13, 2020 03:56 PM

Thank you, that solved my problem

SN Sivamathi Natarajan Syncfusion Team February 14, 2020 03:48 AM

Hi Rainer, 
Thanks for the reply. Please get in touch with us if you would require any further assistance.  

Live Chat Icon For mobile
Up arrow icon