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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridextras by Craig Boyd and LockColumns property 1

Status
Not open for further replies.

torturedmind

Programmer
Jan 31, 2002
1,052
0
0
PH
Good day to all.

I have this small problem with Craig Boyd's Gridextras and the grid's LockColumn property. One of the columns places itself randomly across the grid after calling the SETUP method of the said class. Anyhow, here's a straight-forward procedure of what I did so maybe someone can reproduce this behavior:

1. In the Project Manager, I clicked "New" to create a new form visually.
2. Dropped a pageframe on the form with 2 pages
3. Dropped a grid in each page and set the ColumnCount of both grids - grid #1 on page 1 is 15 while the other is 26
4. Then dropped 2 gridextra classes on the form
5. In the gridextra's "gridexpression" properties, I specified my grids
6. Placed a command button on the form and put the codes that will do the populating of the grids in the click method
7. In the same click method, I set the LockColumns property of both grids to 2 then called the SETUP methods of both gridextra classes.
8. Then I decided to add 2 more columns in grid #2, making its ColumnCount to 28.

I dunno why but LockColumns property (and not LockColumnsLeft) locks the left side of the grids which is what I need. Problem is, the 2nd to the last column of grid #2 randomly places itself across the grid during runtime. I haven't look into the gridextras class code yet so i have no idea if its really the culprit. It could also be VFP9 bug, I dunno. Or maybe am doing (or did) something wrong. Any ideas?

TIA

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
Without downloading and testing all this, I make the assumption the gridextra class isn't prepared for grids with LockColumns.

Making that assumption it should work fine to populate the grid, if you don't set Lockcolumns, and after you called the setup method you would have the grid as needed without locked columns. You can try that, and if that's the case the simple solution is to lock the columns afterwards, then. So first call setup, then set the Lockcolumns to 2. It would make sense anyway, if the columnorder only is established correctly after setup and not beforehand.

Even if that assumption is wrong, it's a simple and fast thing to try this, instead of diving into some other developers code, isn't it?

By the way: LockColumns and LockColumnsLeft both lock the leftmost columns, The left in LockColumnsLeft is about the left PANEL. And a grid only has a right and left PANEL, after you set Grid.Partition. You can answer such questions on your own reading the help topics.

Bye, Olaf.
 
Olaf,

That made sense. Also did the job done. Thanks [thumbsup2]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top