FlexGrid checkbox color based on CellStyle

Posted by: wknauf on 22 April 2024, 9:22 am EST

  • Posted 22 April 2024, 9:22 am EST - Updated 22 April 2024, 9:27 am EST

    Hi C1,

    there was a small behavior change in rendering of checkbox content in .636: see attached sample:

    FlexGridCheckBox.zip

    The grid has an “Alternate” style. The CellStyle backcolor is not applied to the checkbox background when the cell is focused. This happened in .631. Is the new rendering intended behavior or a regression? At least the white checkbox background does not look nice :wink:

    Please ignore the two rows with custom styles - I played with styles a bit, because I did not notice before now that the CellStyle colors are also applied to the checkbox. But I assume this was an intentional change and is contained in all .NET 6 versions.

    Best regards

    Wolfgang

  • Posted 23 April 2024, 6:54 am EST

    Hello Wolfgang,

    Thank you for reporting this behavior. We have escalated it to the developers to get their insights on the behavior and will update you once we get the necessary information.

    As for the workaround, you can handle the AfterRowColChange event to set the backcolor of the cell as follows:

    if(e.NewRange.c1 == 2 && 
        e.NewRange.r1 != 3 && 
        e.NewRange.r1 != 4)   //handle custom cellstyles you have set
    {
        if (e.NewRange.r1 % 2 == 1)
        {
            e.NewRange.StyleNew.BackColor = c1FlexGrid1.Styles.Alternate.BackColor;
        }
        else
        {
            e.NewRange.StyleNew.BackColor = c1FlexGrid1.Styles.Normal.BackColor;
        }
    }


    Please refer to the attached sample for implementation. (see FlexGridCheckBox_Mod.zip)

    [Internal tracking ID: C1WIN-31990]

    Regards,

    Uttkarsh.

  • Posted 19 September 2024, 5:41 am EST

    I found this in the readme:

    [FlexGrid] Checkbox’s backcolor in alternate cellstyle was not working as it should. (Jira:C1WIN-32002)

    Though it is a different JIRA number, I assume this fixes this issue. Could you confirm it?

    Best regards

    Wolfgang

  • Posted 20 September 2024, 12:05 am EST

    Hello Wolfgang,

    Apologies for not providing the bug tracking ID for the issue. However, the issue has been resolved in the 2024v1 hotfix 2.

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels