Differences between 10Tec iGrid and vbAccelerator SGrid (vbalSGrid6)
This section lists the main differences between our iGrid control and the original vbAccelerator SGrid. It's not a full list - you can find out more about plenty of additional methods, events and properties implemented by us in other sections.
Built-in editors (textbox, combobox and checkbox)
The first and the most significant change we have implemented is the ability to edit cells using built-in editors. The current version of iGrid allows you to use the following built-in editors:
All these editors fully support events which allow you to control the editing process (see below).
Variant cell values
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).
In the original SGrid you can operate only with strings stored in its cells.
Events for total control over editing
iGrid has its own set of events which allow you to control the editing. Among them are RequestEdit, BeforeCommitEdit, AfterCommitEdit and CancelEdit. The following figure illustrates how these events work together:
Here is a short description of these events:
| Method with syntax |
Description |
RequestEdit( _ ByVal lRow As Long, _ ByVal lCol As Long, _ ByVal iKeyAscii As Integer, _ ByRef bCancel As Boolean, _ ByRef sText As String, _ ByRef lMaxLength As Long) |
iKeyAscii - returns the ASCII code of the key that has just been pressed (or zero for a mouse double-click); bCancel - used to protect a cell from editing; lMaxLength - the maximum number of characters for textbox editing |
BeforeCommitEdit( _ ByVal lRow As Long, _ ByVal lCol As Long, _ ByRef eResult As EEditResults, _ ByVal sNewText As String, _ ByRef vNewValue As Variant) |
eResult - igEditResCommit (apply changes), igEditResCancel (cancel changes) or igEditResProceed (don't finish editing); vNewValue - you can change the value stored in the cell if the cell text doesn't coincide with the cell value |
AfterCommitEdit( _ ByVal lRow As Long, _ ByVal lCol As Long) |
The lRow and lCol parameters in all of these events specify the edited cell. |
CancelEdit( _ ByVal lRow As Long, _ ByVal lCol As Long) |
|
You can also use specific events for the textbox editing feature - TextEditChange, TextEditKeyPress, TextEditKeyDown and TextEditKeyUp. These events work like the respective standard events of VB TextBox and allow sophisticated tuning of textbox editing to be set up.
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 LayoutSort property.
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.
No external dependencies
SGrid uses the external subclassing and timer assistance library SSubTmr (SSubTmr6.DLL). Our development policy is not to have any external dependencies, so you just need to have the iGrid OCX file to incorporate iGrid into your app.
By the way, despite this fact iGrid provides you with the ability to browse ADO and DAO recordsets, and gives you the native look-and-feel (uses visual styles) in all recent versions of MS Windows including Vista and Windows 7 without any references to external DLLs!
Online library of extra samples for iGrid »
|