Well worry no more, here now is my latest class on ssUltimate library that deals with Grid, i.e., GridX. This combines all the power of all my other classes for grid object (AnchorSizer, AnchorX, GridSort, GridLock, and GridSortLock) into this one class, and more.
With this class now, you are giving your users the power to manipulate further grid on runtime based on their taste. This class retains their last selections that whatever have been set when they exit the form, the grid will be loaded back to the last arrangement and look; just the way they left it. And the good thing is, customization is per workstation. Different users, different tastes.
So when they started complaining, you can casually tell them "Oh, you can adjust the appearance based on your taste", with a smile.
- Retains Column positions, so your users can rearrange columns via drag and drop based on how they like it
- Retains Column Widths. So your users can adjust the widths of individual columns per their satisfaction
- Hide/Unhide Columns
- Retains the last order selection and which column was ordered
- Retains which column is locked or if lock is removed
- Allows your user to toggle RecordMark and retain it
- Allows your user to toggle Theme and retain it
- Allows your user to toggle Grid Lines and retain it
- Allows your user to toggle Scrollbars and retain it
- Allows your user to toggle Highlight and retain it
- Allows your user to change grid's FontName, FontSize, FontBold and FontItalic; and retain those
- Allows your user to change grid's BackColor & ForeColor, and retain those
- Allows your user to change grid's Highlight BackColor & ForeColor, and retain those
- Allows your user to change gridlines' color and retain it
- Allows your user to adjust Header Height, and retain it
- Allows your user to adjust Row Height and retain it
- Allows them to change the font of popup, and retain it
- Gives user the ability to issue AutoFit (of all columns, if button for that is hidden)on-the-ply
- Allows your user to reset it back the way you originally set it up during design time.
Logical Anchor property was set here. This is to either resize the inside columns of the grid or not. By default I set this as .F.. This one is not available during runtime so is beyond user control.
Depending on the number of columns used on a grid, you may want to use this or not. For instance, if you have more columns than the grid can display and you plan to use the horizontal scrollbar for user to see those, then you leave this as .F.. If you have only few and you wanted that when the form (and Grid if you set its Anchor property other than zero) gets resized, to resize all columns as well, then set Anchor property of this class to .T..
- Left click on header to sort, click on the same header to toggle order
- Right-click on header for some popup options such as locking and hiding of columns and unlocking and showing those back
- Right-click on grid cells for the popup shown above
Popups' appearance are controlled by FontName and FontSize of the class. Default is Calibri 10.
How to Use it?
- Drop the class on form
- Double-click on target grid and on its Init event, type this: thisform.gridx1._bindgrid(this)
You can additionally set the popup font via FontName and FontSize and as mentioned, if you want the columns to be resized, change Anchor property value; on the class itself. The rest will be handled by the class itself.
One grid, one instance of the class. The class will latch onto which grid so it can restore it back to its last appearance.
The goal of this class is to provide user satisfaction. Some of our users may have poor eyesight so they may want bigger fonts. Some may be color blind and this class will enable them to adjust our grids to something that is comfortable with their eyes. Some simply just have their own taste on fonts and colors. In other cases, they may be running your app on a wide screen that it can be better for them to increase the fonts and adjust the columns themselves so they can see better. There are lots of reason why giving them control over the grid appearance is better, than not.
I may add some more features in the future. Since this has everything the aforementioned classes have, then all my future works for grids will now only be done on this one. So if you are a new subscriber and hasn't used yet any of those now legacy classes, then just use this and forget about the others mentioned above.
If you haven't subscribed yet to ssUltimate library, I urge you to subscribe now before I suddenly increase subscription again to USD 50 (which I will do, I won't tell you when). Subscription is just one time so if you got this at a lower price like my first subscribers (originally at USD 20), I won't require anyone to send me the difference. Cheers!