warrencc
asked on
FlexGrid
Can someone tell me how to Autosize the Row height in a Flex Grid. I have a Memo field that will contain a large amount of text and need to be able to read it all. Either Autosize the row or provide some type of scrolling ability so as to be able to view ALL the data in the field
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Create the following subroutine in the form which has the flexgrid:
Private Sub FixFlex()
Dim nRow As Integer
lblCellText.Width = MSFlexGrid1.ColWidth(6)
For nRow = 1 to MSFlexGrid1.Rows - 1
lblCellText.Caption = MSFlexGrid1.TextMatrix(nRo w, 6)
MSFlexGrid1.RowHeight(nRow ) = lblCellText.Height + 240
Next nRow
End Sub
Now call FixFlex right after adding data to the FlexGrid or after refreshing your data control.
Private Sub FixFlex()
Dim nRow As Integer
lblCellText.Width = MSFlexGrid1.ColWidth(6)
For nRow = 1 to MSFlexGrid1.Rows - 1
lblCellText.Caption = MSFlexGrid1.TextMatrix(nRo
MSFlexGrid1.RowHeight(nRow
Next nRow
End Sub
Now call FixFlex right after adding data to the FlexGrid or after refreshing your data control.
ASKER