Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Column hide & lock size
Message
From
16/11/2002 12:30:16
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00723546
Message ID:
00723554
Views:
8
Hi Mel:

>If they are not required, I don't want them to show up in the Grid at all. I have set in the grid.Init() its Grid.Column1.Visible = .F., and its Grid.Column1.Width = 0. However, the Grid still opens up with a blank column. How in this situation can I have the Grid open up without the blank column showing up at all? Is there a better way to drop this column altogether than the way I am doing?
>
>Also, is there a way to "lock" a column so that it can't be resized? or at least it can't be resized so small that the column contents can not be seen?

The two things you are trying to achieve are either not in or dont work properly in VFP7. In VFP8 column.visible=.F. does just that. The column disappears. In VFP7, you get the blank column you are seeing. The locking of a column is a new feature in VFP8. So, you could wait for "8" <s>.

It all depends on how detailed your grid is. You could programatically build your grid at runtime adding the columns you need. However, this would obviously take a lot of code. Alternatively, maybe you could consider building the two versions (or more) of the grids you need in containers and save them as classes. Then, at runtime, depending on your requirements logic, just use addobject and drop an instance of the grid container class your require on the form, pre-configured, so to speak. This is similar to a technique you can use in Codemine in page frames. You can create your controls in a container, save as a class, and then when the page is activated for the first time, the container is added to the page. Whilst the reasons for doing this are not the same, the approach is similar. You can create a container of a known size containing the grid. Then when you addobject, you specify the exact location on the form where you want the grid to be. Know one will know the difference, except you. Oh, and me!

Maybe this will give you another angle to consider.

HTH
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform