Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Column Locking and Header Labels
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00783467
Message ID:
00783479
Views:
11
Opps, I didn't mean to post this when I did.

I also wanted to add that the purpose of the code below was to have a label (.lblHeader) move with the grid when it's scrolled left or right. It doesn't work the way it orignally did when the LockColumns or LockColumnsLeft properties are used. The problem seams to be that the .LeftColumn property is always set to '1' because of the column locking feature new to VFP 8. I suspect there's a way to do this, such as another one of the grid's property, I just can't figure out which one and how to use.

Can anyone suggest a way to move a label on a form so that that its position is consistent (e.g., always above) the position of a grid's column. Any advice is welcome.

>I'm attempting to use the left column lock feature with grid that have many columns (10+) where a separate label object is used. This label is above the grid (not directly related to a grid column), and I want it to be positioned to one of the columns the grid. My problem is that I can't figure out what the code needs to be to allow the header label to move when I scroll the grid when the grid has one or more columns locked on the left.
>
>I knew how to do this in VFP 7 using the split partition feature, but I want to use the left column lock feature and forego the dual-pane presentation in the grid.
>
>Here's the code I used with the split partition. This is code is in the Scolled method of the grid ...
>
>LPARAMETERS nDirection
>IF nDirection >= 4
> WITH this
> .Partition = iif(.LeftColumn > 1, .Column1.Width + 16, 0)
> .Parent.lblHeader.Visible = .F.
> lnColOffset = .LeftColumn - 1
> lnLeft = .Partition + .left
> lnPanelLeft = lnLeft
> IF .Column3.ColumnOrder > lnColOffset
> FOR i = 1 to this.ColumnCount
> lnLeft = lnLeft + iif(j > lnColOffset AND ;
>.Columns(i).ColumnOrder < lnCACO, .Columns(i).width + 1, 0)
> ENDFOR
> ENDIF
> lnGridWidth = .Width
> ENDWITH
> WITH this.parent
> .lblHeader.Left = iif(lnLeft > lnPanelLeft, lnLeft - 14, 0)
> .lblHeader.Visible = between(.lblHeader.left, lnPanelLeft, lnGridWidth)
> ENDWITH
>ENDIF
Dave
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform