How to change background color and font color in SfPivotView tool bar dropdown list?

Good Day Syncfusion,

         How to change background color and font color in SfPivotView tool bar dropdown list?, because in clicking items with dropdown list white background only appears and in mouse hover the background color and font color is like in my main menu and side menu, what is the solution please check picture files, i'll be send my sample codes and picture files for reference.


Thanks and God Bless

Nelson


Attachment: Sample_Files_b27acc56.rar

7 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team March 4, 2024 02:04 PM UTC

Hi Nelson,


We believe that your requirement is to apply custom styles to the dropdown menu of the toolbar items. If so, please refer the below code example to apply custom styles to the dropdown menu of the toolbar items.


Code Example:

<style>

    /* Use the below class names to change the styles of toolbar item menu button*/

    .e-pivot-toolbar-menu .e-menu.e-menu-parent .e-menu-item {

        background-color: wheat !important;

    }

    /* Use the below class names to change the styles of toolbar item menu dropdown*/

    .e-pivot-toolbar-menu .e-menu-parent.e-ul .e-menu-item {

        background-color: lightgrey !important;

    }

        /* Use the below class names to change the styles of toolbar item menu dropdown while hovering*/

    .e-pivot-toolbar-menu .e-menu-parent.e-ul .e-menu-item:hover {

        background-color: greenyellow !important;

    }

</style>


Output screenshot:


Meanwhile, we have prepared a sample for your reference. Please find it from the below attachment.


Regards,

Angelin Faith Sheeba.


Attachment: PivotTable_584de69.zip


NT Nelson Tan March 5, 2024 01:40 AM UTC

Good Day  AngelinFaithSheeba PaulvannanRajadurai,

thanks for the quick reply.. how to change font letter color in toolbar menu?, toolbar menu item hover still color green what is the solution?

Image_3102_1709602751240

Image_3076_1709602796508

Thanks

Nelson



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team March 5, 2024 02:07 PM UTC

Hi Nelson,


We have checked the reported issue at our end and the hovering styles applied properly at our end. Also, we have shared the code example to apply font-family along with the background color to the toolbar dropdown items. Moreover, we suspect that the reported issue may occur due to your custom CSS applied in your application. So, we request that you check the custom CSS that you applied to resolve the reported issue at your end.


Code Example:

<style>

       /* Use the below class names to change the styles of toolbar item menu dropdown*/

    .e-pivot-toolbar-menu .e-menu-parent.e-ul .e-menu-item, .e-pivot-toolbar-menu .e-menu-parent.e-ul .e-menu-item .e-label {

        background-color: lightgrey !important;

        font-family: cursive;

    }

    /* Use the below class names to change the styles of toolbar item menu dropdown while hovering*/

    .e-pivot-toolbar-menu .e-menu-parent.e-ul .e-menu-item:hover, .e-pivot-toolbar-menu .e-menu-parent.e-ul .e-menu-item .e-label:hover {

        background-color: blue !important;

        font-family: Arail;

    }

</style>


Output screenshot:


Meanwhile, we have prepared a sample for your reference. Please find it from the below attachment.


However, If the problem persists, please reproduce it in the provided sample and revert to us (or) send your runnable sample with the data source that reproduces the problem. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible.


Regards,

Angelin Faith Sheeba.


Attachment: PivotTable_8c31617f.zip


NT Nelson Tan March 6, 2024 01:16 AM UTC

Good Day  AngelinFaithSheeba PaulvannanRajadurai,


Thanks for quick reply. i'll think the problem is in my main css file but overall my other razor pages menu and font text color is ok.. the problem is only in pivot toolbar menu.. thats why i create css style only in pivot razor page.. i'll share my css file for reference because i dont know how to solve it..


Thanks and Best Regards

Nelson


Attachment: site_2bae0478.rar


AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team March 6, 2024 02:15 PM UTC

Hi Nelson,


We have reviewed the provided CSS and found no pivot table toolbar related style customization available in the provided file. Consequently, we examined the pivot table by integrating the toolbar dropdown styles customization that we provided in our previous response into your CSS file and found that the toolbar styles customization applied properly on our end. Please find the screenshot below for your reference. To illustrate this, we have prepared a sample incorporating the provided CSS, where the customization was successfully applied. Please find the sample attached below.


Output screenshot:


However, we suspect that the reported issue may arise due to the order of CSS files reference in your application end. So, we suggest that you verify the page (for example, _Layout.cshtml) where the CSS files were referred in your application, change their reference order, and then check if the problem is resolved. However, If the problem persists, please share a simple application that reproduces the reported problem in a runnable condition, as this issue only happens on your application's end. It would allow us to analyze the reported problem on our end and give a solution as quickly as feasible.


Regards,

Angelin Faith Sheeba.


Attachment: PivotTable_f65970c3.zip


NT Nelson Tan March 8, 2024 03:03 AM UTC

Good Day  AngelinFaithSheeba PaulvannanRajadurai,


Thanks for quick reply..


Nelson



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team March 8, 2024 10:45 AM UTC

Hi Nelson,


Thanks for the update. Please contact us if you have any other queries. We are always happy to assist you.


Regards,

Angelin Faith Sheeba.


Loader.
Up arrow icon