Link to home
Start Free TrialLog in
Avatar of vmaxx
vmaxx

asked on

Text in top row of FlexGrid?

How do you put text in the top rows of a MSFlexGrid? I can put stuff in all the grids, but not the top row. I am using VB6.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There are two ways of putting text in the top row of the flexgrid.  First, is using TextTatrix with a row index of zero like ryancys has suggested.  You can also use the FormatString property:

tblCustomers.FormatString = "CustNo|Cust Name|Balance"

You'd have to look at the colseparators (?) property.  I think that the pipe symbol separates the columns, but it could be a vbTab character.  You can also include special characters that tell the grid whether to right-align, center or left-align the column:

tblCustomers.FormatString = "^CustNo|<Cust Name|>Balance"
Avatar of Barraza
Barraza

I had the same problem.  This is how I added the first row and then removed the top "blank" row.

FlexGrid1.AddItem "Column1" & vbTab & "Column2" & vbTab & "Column3"

If FlexGrid1.TextMatrix(1, 1) = "" Then FlexGrid1.RemoveItem (1)


Avatar of vmaxx

ASKER

Thats it, I can't tell you how long I went through the help files looking for that simple command.

thanks