Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to freeze a grid column ?
Message
From
25/12/2000 07:05:53
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00452047
Message ID:
00456727
Views:
17
Hi, Martin!

The approach you propose will allow to do not go out of some column when using keyboard. However, user always can use mouse to scroll grid, as well as click on cells. Grid cell will be activated aftre mouse click anyway even when WHEN returns .F., in such case you just cannot edit that cell.

The question was about freezing of column visually, that means - when you scroll grid, frozen column remains leftmost.

>A much simpler way to do it that we use is to RETURN .F. in each column's textbox, except the freezed one, of course.


>
>If you found yourself doing this frequently, you can instrument your textbox base class' WHEN to do it automatically when the textbox is in a column's grid and some grid property is ON. You can defreeze the columns you need either by having a property playing around or by breaking inheritance (that depends in how lazy you'are) 8-)
>
>Hope this helps.
>
>
>>Hi, guys!
>>
>>You can do this programmatically, as I already described in one of threads here. The idea is following:
>>
>>Grid have LeftColumn property that indicates which column in visible part of grid is currently leftmost. Note that leftmost column in visible part shown always completely (unless it is larger than grid width). You can replace this column by some other, (fixed) column, using column.ColumnOrder property. However, you should do this each time grid scrolled horizontally. This means you should do this not only in Scrolled event of grid, but in many other events that fired after grid scrolls self horizontally. For example, this occurs when you resize columns or move columns at right edge of grid, or you click header of column that partially displayed at right edge of grid, or just set focus to grid and focused column in grid is not in visible part. Post of such automatic scrollings does not fire Scrolled event, so you need to catch these in other events of controls, headers or grid.
>>
>>I may try to dig our grid class and list here all places where scroll catching is needed, but this requires time, indeed.
>>
>>HTH.
>>
>>>>Can any one tell me how to freeze one or more columns
>>>>on the left side in a grid table ?
>>>

>>>You cannot really freeze a column, but what you can do is split up the grid into two parts.
>>>If you do not want the user to change that you can have transparant labels over it.
>>>You now only have to implement some code to prevent the user from going into the first column of the second part of the grid.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform