Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Header Caption

Status
Not open for further replies.

COBART

MIS
Sep 7, 2000
33
ID
Hallooo ...
I Have a problem about grid control
I want to display grid header caption in two line or more. because the information on that column need more words.

How to create grid header caption two line or more ?


Thanks,

Rudi
 
Rudi

Increase the .HeaderHeight property of the grid, (19 is default), and place a label(s) over the column(s) of the header(s) in which you want to have more than one row.

Set the .WordWrap property of the label to .T. and enter the caption.

If there is code in the .Click() event of the header, call it from the .Click() event of the label.

Chris :)
 
Hi,
I think GRID.COLUMN.HEADER does not have WordWrapt property

Rudi,
This is one of the solutions:
- Set GRID.HeaderHeight to high enough
- All of GRID.COLUMN.HEADER.Caption=""
- Create a LABEL and put it at the header, Set thisLABEL.BackStyle = Transparent
Now , thatLABEL has WordWrapt property

* Others is
- Set GRID.HeaderHeight = 0
- make a FALSE header

Hope this helps

Jimmy



mailto:nhan_tiags@yahoo.com
 
JimmyK

I think you misread the previous post.

Set the .WordWrap property of the label to .T. and enter the caption

Grid1.Column1.Header1 does not have .WordWrap property

The label(s) with default .BackStyle = 1 - Opaque, will mask out the header(s) in the selected columns(s)

Chris
 
There is a class to replace the header object in grids that allows multi-line display. I have never used it, but I have noticed it more than once at VFP download area. It might be worth a looksey.
-Pete
 
Haloo, Jimmy and Chriss

If My header caption change with label the grid not working properly. Because if the grid with multiple column and the grid is scrool and the column is change, the header caption is not in position .

Maybe any idea pleash ?

thanks

Rudi
 
Rudi

Not too sure if I understand your problem, but you need to make sure that .Label1.Height is the same as Grid1.HeaderHeight, (say 40, 2 row label) and that .Label1 is placed exactly over the .Grid1.Coumn1.Header1, so masking the header.

The label then won't interfere with the workings of the grid.

Chris
 
Chris,

I am sorry of misreading your post.
BTW, your solution and mine are the same, aren't they? :)

Jimmy
 
JimmyK

No problem - solutions are virtually the same - mine uses default BackStyle, yours uses transparent.

Without special class as suggested by Pete, I doubt if there any other options.

Chris :)
 
There is a problem with these solutions. Note: I don't have VFP7.

When I scroll to the right or left, the label moves with the column. But, if the label ever goes out of sight, it does not appear when I scroll back over the column.

Any ideas?

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top