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
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:
With MSFlexGrid1
'Restrict merge to columns
.MergeCells = flexMergeRestrictColumns
'Let's say column 1 can be merged
.MergeCol(1) = True
'Add 2 rows that will merge
.AddItem vbTab & "hi"
.AddItem vbTab & "hi"
'Add an empty row, so merging ends in this row
.AddItem ""
'This will make last added row invisible
.RowHeight(.Rows - 1) = 0
'Add 2 more rows that will merge
.AddItem vbTab & "hi"
.AddItem vbTab & "hi"
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.
[RESOLVED] MsflexGrid Merge Rows
Re: MsflexGrid Merge Rows
that's why we need to keep forums like this exist, people around the world could share
Re: MsflexGrid Merge Rows
For not merging a particular row:
Code:
MSFlexGrid1.MergeRow(Index) = False
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.
Re: MsflexGrid Merge Rows
Quote:
Originally Posted by
jcis
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.
Re: MsflexGrid Merge Rows
Quote:
Originally Posted by
Eduardo-
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"
Re: MsflexGrid Merge Rows
Quote:
Originally Posted by
Eduardo-
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"