Results 1 to 10 of 10

Thread: MsflexGrid Merge Rows

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Unhappy MsflexGrid Merge Rows

    Hi

    sorry for my english


    I Have a Flexgrid have 5 columns

    1) Service
    2) Professional
    3) Value
    4) Qtd


    A Service can to be to made for more than a Professional, but Qtd and Value are constants

    Then When the user choice more than a Professional , I merge columns Service , Value and Qtd
    See Flex1.bmp

    But when I Add other Service with Qtd =1 , I do not Want to merge the Atual row with before Rows (See flex2.bmp)


    Thank You in Advance
    Attached Images Attached Images   

  2. #2

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Unhappy Re: MsflexGrid Merge Rows

    UP



    Please How can I to Calculate the Total doing Column 3 * Column 4 withou repeat the Values , because are mescled

  3. #3
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: MsflexGrid Merge Rows

    Ok, if I understand correctly, the problem is that you don't want to merge column content when rows belong to different items.
    You can solve this problem by adding an invisible row between items, to make a row invisible use:
    RowHeight(Rownumber) = 0, See this example:
    VB Code:
    1. With MSFlexGrid1
    2.         'Restrict merge to columns
    3.         .MergeCells = flexMergeRestrictColumns
    4.        
    5.         'Let's say column 1 can be merged
    6.         .MergeCol(1) = True
    7.  
    8.         'Add 2 rows that will merge
    9.         .AddItem vbTab & "hi"
    10.         .AddItem vbTab & "hi"
    11.        
    12.         'Add an empty row, so merging ends in this row
    13.         .AddItem ""
    14.         'This will make last added row invisible
    15.         .RowHeight(.Rows - 1) = 0
    16.        
    17.         'Add 2 more rows that will merge
    18.         .AddItem vbTab & "hi"
    19.         .AddItem vbTab & "hi"
    20.     End With
    It will be easier if you run that code in another project, in an empty flexgrid, then if it is what you want, add it to your project.

  4. #4

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Talking [RESOLVED] MsflexGrid Merge Rows

    WORK FINE !!!


    thank you

  5. #5
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: MsflexGrid Merge Rows

    that's why we need to keep forums like this exist, people around the world could share

  6. #6
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,064

    Re: MsflexGrid Merge Rows

    For not merging a particular row:

    Code:
    MSFlexGrid1.MergeRow(Index) = False

  7. #7
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: MsflexGrid Merge Rows

    Omg 13 years old thread resurrected lol.
    Btw Eduardo's answer is much better! No need to be adding rows to cut merging.

  8. #8
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,064

    Re: MsflexGrid Merge Rows

    Quote Originally Posted by jcis View Post
    Omg 13 years old thread resurrected lol.
    Btw Eduardo's answer is much better! No need to be adding rows to cut merging.
    But consider that it won't work on all cases, because suppose that there are three rows merged, then you need to start another row group of lets say two rows, if the first one has MergeRow set to false, then it won't merge with the other row.

  9. #9
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: MsflexGrid Merge Rows

    Quote Originally Posted by Eduardo- View Post
    But consider that it won't work on all cases, because suppose that there are three rows merged, then you need to start another row group of lets say two rows, if the first one has MergeRow set to false, then it won't merge with the other row.
    well..for some cases..you need to do "extra" coding for checking.. but at least what you did open the "view"

  10. #10
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: MsflexGrid Merge Rows

    Quote Originally Posted by Eduardo- View Post
    But consider that it won't work on all cases, because suppose that there are three rows merged, then you need to start another row group of lets say two rows, if the first one has MergeRow set to false, then it won't merge with the other row.
    well..for some cases..you need to do "extra" coding for checking.. but at least what you did open the "view"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width