If you are a Visual Basic developer and ever needed a grid control to implement unbound grids, you may already know an excellent grid control called vbAccelerator SGrid Control:
The earliest internal versions of iGrid in far 2000-2001 were based on this SGrid control, though iGrid was enhanced a lot in the future and was released as an independent control with enhanced ideology and powerful improvements on this site in 2002. The author of the original S-Grid control, Steve McMahon, also released a major update called vbAccelerator SGrid II Control on his website later.
You can find out more about the creation history of iGrid and the main difference between this 10Tec grid and vbAccelerator SGrid control on this page.
The early history of iGrid
It seems, every Visual Basic developer ever creates an interface that displays tabular data. Sometimes the data should be editable. Users often want to manipulate these data - to sort and search, to group rows, etc. Also, the rows of data aren't always stored in a database and may contain a lot of graphical information.
If you want to use one of the standard Visual Basic grid controls in such applications, you will find that neither MSFlexGrid nor ListView from MS Common Controls in the report mode can provide you with the functionality described above to the full.
Our company was also confronted with such difficulties while developing applications for our local customers, so we decided to create own grid control that would allow us to implement the tasks described above. We didn't want to create a control that only automates all standard tasks (sort, search, etc), we wanted the developer to have influence on these processes and adjust them exactly the way they need.
We started to search for source codes that can help us to implement our needs, and found an excellent website with source codes - vbAccelerator.com. vbAccelerator's source codes and binaries are provided for your reuse in any of your projects, whether proprietary, commercial or open-source according to their Usage Policy, so it was the closest thing to what we were looking for.
One of the vbAccelerator components was SGrid control, but originally it could only display but not edit data. We wanted to implement an editable grid control and include built-in editors like singleline and multiline textboxes, comboboxes with icons and checkboxes into it. Moreover, these editors must have been integrated with the displayed data, and the developer should have been provided with a standard set of events which work identically for all built-in editors.
As a result, we created the iGrid ActiveX Control. We have been working on this component since 2000, and are continuing to enhance its functionality today. It required many years to fix all the bugs in the unsupported SGrid, incorporate the built-in editors, optimize it so it works much faster, and also add many big and small useful features which make the life of the developer easier.
Main differences between vbAccelerator SGrid and 10Tec iGrid
Built-in cell editors
vbAccelerator SGrid control in its original implementation does not provide you with any cell editing features. In SGrid, you can just display strings but you cannot even edit them using a text editor like the standard text box. iGrid gives you built-in cell editors to edit texts "as is" or to use a drop-down (combo) list to select a predefined value. Another useful control which can be displayed in any cell is check box. The Built-in Cell Editors page in this section will give you more detailed info about the iGrid editing features.
Variant cell values
In the original SGrid you can operate only with strings stored in its cells. Every cell of iGrid has a cell value of the Variant data type (the
CellValue property) and provides you with the corresponding string representation on the screen (it can be retrieved with the read-only
CellText property of the String data type). Thus a cell can store any value you want, and the displayed representation of this value may differ from the cell value a lot (for instance, you can use format strings or dynamic cell text).
Different images in cells and column headers
SGrid allows you to use icons for its cells and column headers stored in a single ImageList. This is a serious restriction if you wish to use icons of different sizes for your cells and column headers - for instance, small 16x16 icons in column headers and larger more detailed 32x32 icons in the grid cells. iGrid does not have this restriction:
You can use images in all its constituent parts (cells, column headers, combo boxes), and each item can be linked to its own image list. Moreover, you can even use up to different 15 image lists for the cells!
More effective coding
iGrid provides you with many methods and properties which automate frequently performed tasks, but in SGrid you should write 20-50 lines of code to do that. Here are a couple of samples.
You can use the
DoDefaultSort method to sort the specified column as if the user clicked its column header (if the column has not been sorted, it is sorted ascending; otherwise it is sorted descending, and vice versa). This method also allows you to add new columns to the existing set of sorted columns programmatically to implement multi-column sorting.
It is considered as a good form if your application saves the order and width of each column, and restores these parameters when the user launches the application with your grid next time. iGrid automates this task by providing the
LayoutCol property to developers. To implement such functionality, save the string returned by this property when the user closes your application, and assign the stored value to the
LayoutCol property when the user launches your application again. iGrid will automatically restore the order, width and visibility for each column. You can also do the same to save and restore the current sorting criteria with the
Fast population and row deletion
Sometimes you need to add a huge amount of rows to a grid, and the number of rows to add is not known beforehand. SGrid works slowly if you add a lot of rows using the
AddRow method. iGrid uses effective page memory allocation technology which speeds up the execution up to ten times.
vbalsgrid6.ocx run-time error '0' and other problems
vbAccelerator SGrid is implemented in the VBALSGRID6 OCX file. However, it uses the external subclassing and timer assistance library named SSubTmr, which is implemented in the separate SSubTmr6 DLL. To use vbAccelerator SGrid on the computers of your clients, it is not enough to redistribute and register vbalsgrid6.ocx. You also need to include SSubTmr6.DLL into the deployment package and properly register it as an ActiveX COM DLL on the client computers. If anything is wrong with this external DLL, your application becomes completely unusable - you get vbAccelerator SGrid II Control Run-Time Error '0' or something like that.
Our development policy for all 10Tec controls is not to have any external dependencies, so in the case of the iGrid grid control you just need to redistribute the iGrid OCX file with your app.
Despite this fact, iGrid even provides you with the ability to browse ADO and DAO recordsets using COM late binding. It also gives you the native OS look-and-feel by using the OS visual styles in all recent versions of MS Windows including Vista, Windows 7 and Windows 10 - and all this is implemented without any hard-coded references to external DLLs.
All revealed SGrid bugs were fixed
Actually, creating a good and robust grid control is a hard and long-long road, and our comprehensive What's New documents written for every 10Tec control prove that. Many users already heard about that sadly known runtime error 0 in vbAccelerator SGrid, but there are more subtle bugs related to functionality and drawing routines in SGrid you can download from vbAccelerator.com. Even after 5 years of work on iGrid, our users reported bugs which had come from the SGrid code - and we are still fixing all of them in our grid control. Unfortunately, vbAccelerator SGrid II Control is no longer supported, but as for iGrid, we are proud to say that we have fixed all known bugs in it.