Background color of specific Group ?

How to set a background color for a specific group ?


3 Replies 1 reply marked as answer

RM Ruksar Moosa Sait Syncfusion Team January 25, 2022 02:50 PM UTC

Hi Yordan,

You can set the background color of the specific group by overriding the Css for the GroupIndex in OnRenderCell method like below code snippet.


public void OnRenderCell(RenderCellEventArgs args)

    {

        if (args.GroupIndex == 1)

        {

            args.CssClasses = new List<string>(CellCustomClass1);

        }

        else

        {

            args.CssClasses = new List<string>(CellCustomClass);

        }

    }


<style>

    .e-schedule .e-month-view .cell-custom-class {

        background: #849aae !important;

    }

    .e-schedule .e-month-view .cell-custom-class1 {

        background: #e8d485 !important;

    }   

</style>


Kindly try the attached sample and let us know if this meets your requirement.

Regards,

Ruksar Moosa Sait


Attachment: Background_color_for_specific_group_f724eabf.zip

Marked as answer

YO Yordan January 25, 2022 09:52 PM UTC

Great solution!

Thank You very much Ruksar Moosa Sait



VM Vengatesh Maniraj Syncfusion Team January 26, 2022 04:11 AM UTC

You are most welcome Yordan!!!


Loader.
Up arrow icon