Tuesday, November 8, 2011

ssGridLock

I never liked horizontal scrolling capabilities of grids because I wanted everything to be seen outright without the need to scroll.  So I never used grid column locking before and most of my classes that deals with grids is designed without horizontal scrollbar in mind like ssAnchorSizer.

But, taste and need changes and in one of my modules I am forced to put a grid where some columns are hidden and the need to scroll horizontally cannot be avoided.  And since I don't want to guess "where" I am when I scroll to the right, I need to lock columns on the left.  And with that need arises ssGridLock class.





Using it is very easy like my ssGridSorter class.  Just bind the grid you wanted to attach to that column locking capability like this (on class Init event):

This._GridName = "Grid1"

By default, it will lock the 1st column of the grid but you can adjust it to initially show more than one column locked also via init event like this:

This.Value = 2  && locks 2 columns initially

Or via its value property on the PEM window.

This class will create a lock image on the column of your grid so you will know which column is currently locked.

And since it is included with a spinner, you can change locking dynamically on run by changing the spinner value up or down or by manually keying in the  number of columns to be locked.

Like my other grid classes, the class and the grid should be on the same container.  So a grid in the form must have that class on the form as well.  If the grid is inside a container object, then the class should also be inside that container.  If the grid is inside a page, the class should also be in that same page.

2 comments:

  1. Replies
    1. Hello Irfan, it is part of ssClasses library. See ssClasses Library now in VFPx blog (visible on my Popular Posts in the right side hereof)

      Delete