Grid Merge Function

Posted by: duwhd791 on 14 November 2021, 12:45 pm EST

  • Posted 14 November 2021, 12:45 pm EST

    Hello, I have a question about the grid merge function.

    *********************************************************************
    For Row as integer = grid.Rows.Fixed To grid.Rows.Count - 1

    Dim flag As Integer = grid.GetData(Row, "flag")

    Select Case flag
    Case 1
    range = grid.GetCellRange(Row, 2, Row, 7)
    grid.MergedRanges.Add(range)
    range = grid.GetCellRange(Row, 9, Row, 15)
    grid.MergedRanges.Add(range)
    *********************************************************************
    If the source is coded in that way, the merge part is correct when inquiring the data for the first time.

    However, if the next data is inquired, the current grid merge is applied in addition to the previous grid merge, and the merge values are mixed and inquired.

    Is there a way to initialize the merge value every time it is inquired?
  • Marked as Answer

    Replied 14 November 2021, 4:15 pm EST

    Hi,

    You can clear the merge value every time the data is inquired by using the grid.MergedRanges.Clear() method and then create the merging again for the new data inquired.
    We have attached a sample to show the same.
    Please let us know if you need any other information.

    Regards
    Avnish

    CellMergeDemo.zip
  • Replied 14 November 2021, 6:16 pm EST

    Thank you, Avnish.

    I've been looking for this code for a long time.
    I checked that it's working normally.
    Thank you so much!

    Regards
    YJ
Need extra support?

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

Learn More

Forum Channels