C1Flexgrid merge cell extended

Posted by: saidnai on 8 October 2024, 7:33 am EST

    • Post Options:
    • Link

    Posted 8 October 2024, 7:33 am EST - Updated 8 October 2024, 7:38 am EST

    Hi,

    I habe an issue regarding the C1Flexgrid merge Cell. the code is working fine. Unlikely when values are the same, the merge cell is extended to the next Cell.

    is there a possiblility to stop and execute the merge as per code?

    I have attached a VB sample including an mdb as zip. I hade to delete the DLLS to get it smaller.

    I also attached a picture to show where the merge is extended.

    Best regards

    Said

    C1Flexgrid Style.7z

  • Posted 9 October 2024, 2:30 am EST

    Hello Said,

    For this, you’ll have to custom merge cells by overriding both the GetMergedRange() and GetData() methods, and have GetData() provide your custom data while the grid is calculating the merged ranges.

    Please refer to the attached modified sample for implementation of the same.

    Sample download link: https://drive.mescius.io/download/temporary-share/ce5fa220-5cbe-4066-ae6d-717a4f7d4337

    You can also refer to the ‘CustomMerge4’ product sample located at

    .\Documents\ComponentOne Samples\WinForms\v4.8\FlexGrid\CS\CustomMerge4
    on your machine.

    Regards,

    Uttkarsh.

  • Posted 9 October 2024, 3:10 am EST - Updated 9 October 2024, 3:15 am EST

    Dear Uttkarsh,

    Thanks for the quick reply.

    Is it possible to hide at the same the frame lines in red circle?

    See attached picture.

    Best regards

    Said

  • Posted 10 October 2024, 12:41 am EST

    Hello Said,

    You can set the CellStyle.Border.Direction property to BorderDirEnum.Horizontal to render only horizontal borders in the intended cell as follows:

    For c = 2 To DGEW.Cols.Count - 3 Step 2
        Dim style = DGEW.GetCellStyleDisplay(2, c)
        style.Border.Direction = BorderDirEnum.Horizontal
    Next

    Please refer to the attached modified sample for the same. (see C1FlexgridStyle_Mod2.zip)

    Regards,

    Uttkarsh.

  • Posted 10 October 2024, 8:57 am EST

    Dear Uttkarsh,

    Perfect.

    Best regards

    Said

Need extra support?

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

Learn More

Forum Channels