10Tec Company
top bar image
Free Newsletter
Your e-mail:


The Differences between 10Tec iGrid and vbAccelerator S-Grid

This section describes the main differences between the latest version of our iGrid control and the original vbAccelerator S-Grid. This is not a full list of the differences. There are a lot of additional methods, events and properties which you can find in other sections of our site. Here are only the most significant features.

 1 The first and the greatest changes that we have made is the ability to edit cells using built-in editors. The current version of iGrid allows you to use the following built-in editors:
Singleline and multiline textboxes
(optionally with vertical and/or horizontal scrollbars):
Comboboxes with icons: Two- and three-state checkboxes (with flat or 3D style):
Note that all of these editors fully support events that allow to control the editing process (see the next two items).
 2 For each cell iGrid stores a cell value (the CellValue property of the Variant data type) and provides you with the read-only CellText property of the String data type that returns the text displayed in the cell. You can store in the cell value any value you want, and the displayed representation of this value may differ from that value. This is a very useful feature: you may store in the cell a customer id from a database and display its name on the screen, you may store boolean True/False and display a checkbox or combolist with two items (for instance, "Enabled" and "Disabled"), etc.

The CellValue property is inseparably linked with the CellText property: when the user changes an editable cell, the CellValue property is automatically changed by iGrid (iGrid knows how to convert the edited value to the cell value!). And vice versa, if you change in the code the cell value, the representation on the screen is changed respectively. It works for all types of cells (textbox, checkbox and combo)!

 3 iGrid has its own set of events that allows you to control the data entered by the user. 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 doubleclick on the mouse);
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.

 4 S-Grid allows you to use icons for its cells and column headers from a single ImageList. It is not a good choice if you want to use, for instance, 16x16 icons in column headers and 24x24 icons in grid cells.

iGrid can use images in all of its elements (cells, column headers, combo boxes) and can be linked to two separate image lists - one image list for column headers and another image list for cells and combo boxes. This means that you can separately use images of one size for column headers and images of another size for grid cells.

 5 iGrid provides some methods and properties which automate frequently performed tasks that must be implemented using 20-50 lines of code in S-Grid. Here are a couple of samples.

The DoDefaultSort method sorts the specified column by ascending. If the column has been sorted by ascending order, the DoDefaultSort method sorts this column by descending order. If the grid has the header ImageList, the first icon from this ImageList will be displayed in the column header for ascending order and the second icon - for descending order.

It is considered as a good form if your application saves the order positions and width of each column of each grid, and restores these parameters when the user launches your application next time. iGrid automates this task by providing the LayoutCol property to developers. To implement such functionality, save to any place the string value returned by this property when the user closes your application. When the user launches your application again, assign the stored value to the LayoutCol property, and iGrid automatically restores the order, width and visibility for each column.

 6 Sometimes you need to add many rows to the end of a grid, and the number of rows to add is not known beforehand. S-Grid works slowly if you add a lot of rows using the AddRow method. The current version of the grid allows you to use a built-in memory manager that is accessible through the MemMngWantFreeRows and MemMngAllocatedRows properties. The memory manager allocates memory for a block of rows, not for a single row. It enables you to reduce the time taken to add rows by up to ten times.
 7 S-Grid uses the external subclassing library SSubTmr.DLL. The iGrid control doesn't use any external libraries, and you can safely use it in compiled applications and in VB IDE without crashing.
 
In this section:
Download Demo
  Back to Top
Visit our partners:
Visual Basic News & Information Source Tools and components for software developers ViewSlip - Perfest products for your business! Quality Tools for Serious Microsoft Developers Shareup Networks Downloads vbAccelerator.com Download software from TopShareware.com Shareware and Freeware downloads and tested, rated and reviewed software submitted by software author.
Everything Visual Basic, from Visual Basic 3 to Visual Basic Xml Upload.com: a web service for promoting and selling software online
© 10Tec Company. Last updated: 20 Mar 2008