How to use C1Flexgrid Merging Custom?

Posted by: udommeng on 22 November 2019, 11:04 pm EST

    • Post Options:
    • Link

    Posted 22 November 2019, 11:04 pm EST - Updated 4 October 2022, 12:30 am EST

    I am using c1flex grid and i want to merge cell like in this picture

    I have to group of data which each group has 2 record or more.

    the Group number is the first column ‘Sample Code’. I want to merge cell only within the same group but they are always merged like the column with number 4 and 5. Is there any way to solve this.

    I also try to use merging custom but I have no sample.

    Please help.

    Thanks

  • Posted 25 November 2019, 3:27 am EST

    Hello,

    You can check out the product sample name “CustomMerging4” which demonstrates how to override the GetMergedRange method to customize grouping.

    This sample can be found in your system at location : …\Documents\ComponentOne Samples\WinForms\v4.0\C1FlexGrid\CS\CustomMerge4



    If you need any other help, please let us know.

    Regards,

    Prabhat Sharma.

  • Posted 25 November 2019, 4:37 am EST

    Hi,

    handling of merged ranges is even easier when setting “C1FlexGrid.AllowMerging” to “Custom”: then you can declare merged ranges yourself, independent of the cell content. Unfortunately no sample exists. But I can provide you one if required.

    Best regards

    Wolfgang

  • Posted 25 November 2019, 10:20 am EST - Updated 4 October 2022, 12:25 am EST

    Yes. Please show me some example. I have tried for so many times but not work.

    Thank you.

  • Posted 25 November 2019, 10:35 am EST

    See attached sample.

    FlexCustomMerge.zip

    The code is simple:

          //Activate merge mode:
          this.c1FlexGrid1.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom;
    
          //Define a merged range:
          this.c1FlexGrid1.MergedRanges.Add(2, 2, 2, 3);
    
    

    Best regards

    Wolfgang

  • Posted 25 November 2019, 9:00 pm EST - Updated 4 October 2022, 12:25 am EST

    Thank you very much. This is actually what I want.

Need extra support?

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

Learn More

Forum Channels