FlexGrid personalized group caption

Posted by: fsegui on 2 December 2021, 12:47 pm EST

    • Post Options:
    • Link

    Posted 2 December 2021, 12:47 pm EST

    Hi,

    I’m using C1FlexGrid together with C1FlexGridGroupPanel.

    When the user groups by a column, the header of the group in FlexGrid is the caption of the column.

    For most of my columns, it’s OK but I need to change the caption for one or two columns and define a specific caption.

    Is it possible?

    I’ve seen the GroupHeaderFormat property but it applies to all groups.

    Thanks

    Florent

  • Posted 3 December 2021, 1:20 am EST

    Hi Florent,

    You can handle the BeforeSubtotal event of the C1FlexGrid to check if the grouped column is your specific column and change the e.Caption property with your custom format for that column. Kindly refer to the attached sample showing the same.

    Please let us know if you need any other information.

    Regards,

    Avnish

    GroupHeaderFormat_C1FG.zip

  • Posted 3 December 2021, 1:16 pm EST

    Thanks

    That works fine.

  • Posted 3 December 2021, 4:51 pm EST

    Avnish,

    Is it possible to go a step further?

    Like set a custom caption depending on the value?

    If I group on a column that has 2 possible values, set a caption for value 1 and then set another caption for value 2.

    Regards

  • Posted 6 December 2021, 1:11 am EST

    Hi,

    You can handle the AfterSubtotal event of the C1FlexGrid to check if the grouped column is your specified column and set the group header data based on values in that column by using Node.Data property. Kindly refer to the attached sample showing the same.

    Regards,

    Avnish

    GroupHeaderFormat_V2.zip

  • Posted 6 December 2021, 12:03 pm EST - Updated 3 October 2022, 10:51 pm EST

    Hi Avnish,

    It works for the first group but not the second.

    See picture, 2nd group is not updated.

  • Posted 7 December 2021, 3:04 am EST - Updated 3 October 2022, 10:51 pm EST

    HI,

    The sample works fine at our end. Kindly refer to the attached gif showing the behavior at our end. If you are doing something different, please let us know so we can assist you further.

    Regards

    Avnish

  • Posted 7 December 2021, 3:10 am EST

    Hi,

    Actually, I use your sample.

    To reproduce, group on column brand then ungroup then regroup again.

  • Posted 7 December 2021, 5:12 am EST

    It seems it’s a bug with version 4.5.20210.513

    I’ve updated with version 532 and now it works.

  • Posted 7 December 2021, 11:32 am EST - Updated 3 October 2022, 10:51 pm EST

    Well, It seems there is still a bug.

    See GIF attached, sometimes the Node.Data is not updated.

    What could prevent Node.Data from being updated?

  • Posted 8 December 2021, 4:45 am EST

    Hi,

    We have reported the issue to the development team and will let you know when we have an update.

    In the meantime, as a workaround, You can save your custom caption in the UserData property of the Node rows in the AfterSubtotal Event. Then, you can handle the OwnerDrawCell event to set the group header text to your custom caption by using the e.Text property.

    Kindly refer to the attached sample showing the same.

    Regards,

    Avnish

    GroupHeaderFormat_V3_C1FG.zip

Need extra support?

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

Learn More

Forum Channels