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


iGrid Control - Distinctive Features

In this section we describe the features of iGrid that cannot be found in other well-known grids (or are rarely found).

 1 iGrid works mainly in unbound mode because it was designed as an advanced editable replacement for standard ListView (although the latest version allows you to view ADO recordsets). Some well-known grids like FlexGrid and True DBGrid Pro from ComponentOne (APEX and VideoSoft merged to form ComponentOne LLC) boast an incredibly simple 'array binding' feature – in one line of code, you can bind a two-dimensional array direct to a grid. All changes made in the grid are reflected immediately in the array, and vice versa.

In iGrid, the CellValue and CellText properties are bounded in the same way. You don't even need to create an array – instead of this, you can simply use the CellValue property of the Variant data type. iGrid automatically redimensions its internal array when you are adding or removing rows or columns - you don't need to redimension an externally bounded array like in other grids.

 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 type of cells (textbox, checkbox and combo)!

 3 Due to the CellValue property of the Variant data type, you can store in iGrid any data supported by COM technology and, of course, by Visual Basic.

Moreover, you can even store values of different data types in the same column.

 4 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. These methods work practically equally for all built-in inplace editors (textbox, combobox and checkbox). This set of events allows fine tuning of the editing process.

You can also use specific events for the textbox editing feature - TextEditChange, TextEditKeyPress, TextEditKeyDown and TextEditKeyUp. These events work like the standard events for VB TextBox and allow sophisticated tuning of textbox editing.

 5 iGrid supports virtual mode. In virtual mode, iGrid will request new rows whenever they need to be displayed. This allows you to add rows as they are required.
 6 In iGrid you can format each cell INDIVIDUALLY (even in the same column!) using one or all of the following options:
  • Set background and foreground colors.
  • Each cell can have its own font.
  • Cell icons can optionally be highlighted when selected.
  • Many cell text formatting options. A cell text can be aligned horizontally or vertically; it can appear on a single line or multiple lines; the text can appear with a trailing ellipsis (...) if the cell text is bigger than the cell boundaries.
  • Cells can be indented so that selection and drawing starts at the specified offset.
  • Cells can be included or excluded from the selection box for a row.
  • The value of a cell may be formatted using format strings from the standard VB Format function.
The screenshot below illustrates how you can use these formatting options:
 7 Each cell of iGrid can display an icon from the ImageList attached to the grid. In addition, an iGrid cell can display an extra icon to the left of the main icon. This feature allows you to built, for instance, the following group rows:

Note that the buttons in the group rows above are cell external icons and you can change them in your own way.

 8 The contents of iGrid can be sorted by several columns simultaneously based on a wide range of sorting criteria (cell value, cell text disregarding character case, cell icon or extra icon, selection, cell text indentation, cell fore color and background color, etc, or even by using your own sort criteria). When you sort iGrid by several columns, the control can mark sorted columns by numerated sort icons like on the following screenshot:
 9 iGrid provides you with a lot of methods and properties which automate frequently performed tasks or which allow you to adjust the view of iGrid to your needs. Among them are:
  • The LayoutCol and LayoutSort string properties that allow you to save and restore the grid layout (the width of each column, their position and visibility) and the sort criteria the user has set. You can do it in only one line of code using these properties!
  • The row height can be automatically calculated based on the contents of the cells using the AutoHeightRow method. The AutoWidthCol method allows you to auto fit the column width.
  • The built-in comboboxes have similar methods. The SetHeightInItems method allows you to adjust the number of visible items in the drop-down part of a combo, and the AutoAdjustWidth method automatically adjusts the dropdown list width based on the longest text width of comboitems.
10 Sometimes you need to add many rows to the end of a grid, and the number of rows to add is not known beforehand. The current version of the grid allows you to use a built-in memory manager. When you add (or delete) a new row, 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.
 
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