================================= 10Tec iGrid ActiveX Control 2.0 What's New in the Release ================================= ---------------------------- v2.00 Release (build 0134) June 25th, 2002 ---------------------------- 1.The current version of the grid has own memory manager. Developers can reduce the time of adding, inserting and removing rows using this new feature up in ten times. To do this, you need to choose the right value for the MemMngWantFreeRows parameter of the built-in memory manager. This parameter specifies how many rows is reserved in memory for iGrid when you add a new row and the reserved memory is not enough to store the currently added row. Thus computer memory is reserved for iGrid in blocks. This principle allows to avoid unneeded memory allocation operations that can take a long time. If the value of this parameter is equal to zero (by default), the memory is allocated using the customary scheme (memory is allocated when you add each new row). This parameter is useful if you add new rows to the grid dynamically and you can determine the number of rows only when you program is running. The second parameter of the memory manager, MemMngAllocatedRows, is used to determine the number of rows that is already allocated for iGrid. You can reduce the amount of memory that is allocated for your grid. To do this, assign to this iGrid property the required number of rows and iGrid automatically free unused memory. 2.The FillFromRS method is added. This method allows to populate the grid using data from an ADO recordset. iGrid can use ADO 2.5 or higher. To populate the grid using this method, specify the required ADO recordset as the single parameter of this method. If your grid has had no columns, iGrid automatically creates columns to display all recordset fields. If your grid has had some columns before you issue this method, the keys of the defined columns is used as recordset field names and iGrid displays the data only from the specified fields. 3.The current version of iGrid coins the term "default sorting". This term means that the grid is sorting when the user clicks a column header, and the appropriate sort icon is displayed in the column header; the second click on the header of the sorted column sorts this column in the descending mode. To implement this feature, the DoDefaultSort method has been added. This method sorts iGrid using "default sort" and optionally displays in the sorted column header the appropriate sort icon. If you have specified the header imagelist, the DoDefaultSort method uses its first icon (index #0) as the ascending sort icon and the second icon (index #1) as the descending sort icon. Sort icons aren't displayed if you specify False for the bSortIcon parameter of this method. 4.The SortObject object has the new ColColunt property that returns number of columns defined in this object. 5.The lCol parameter has been added to the ColHeaderRightClick event. This event has the following syntax now: ColHeaderRightClick(ByVal lCol As Long, ByVal x As Long, ByVal y As Long). The lCol parameter stores the index of the column that has been clicked by the user. 6.The ColHeaderDblClick(ByVal lCol As Long) event has been added. 7.The ColDefaultCell(vCol) As CellObject property has been implemented. The value of this property is used to automatically initialize the newly created cells of a column. 8.The AddCol method is a function now. This method returns the column default cell. For instance, you can have the following code: grdCust.AddCol(sKey:="total", sHeader:="Total", lWidth:=60) With grdCust.ColDefaultCell("total") .sFmtString = "$#,##0" .eTextFlags = igTextRight End With Now you can write the following code instead of the code above: With grdCust.AddCol(sKey:="total", sHeader:="Total", lWidth:=60) .sFmtString = "$#,##0" .eTextFlags = igTextRight End With 9.iGrid generates own error messages now. These errors can be trapped using the "On Error" statement as the same way as standard VB errors. Among them are "Subscript out of range", "Invalid procedure call or argument", "Attempt to add rows with no columns", etc. 10.Two new string properties, LayoutCol and LayoutSort, have been added. These properties allows saving and restoring grid layout. You can save and restore visibility, width and order of each column using the first property. The second property allows to save and restore sort order of iGrid. 11.In the edit mode, when the user clicks outside the edited cell, iGrid try to save user input and raises the BeforeCommitEdit event (the CancelEdit event is triggered in the previous version of iGrid). Editing is cancelled in all other events (grid scrolling, mouse clicks on a column header or outside of the grid, and so on). The CancelEdit event is triggered in these cases as well as earlier. Important! Don't use any modal dialog boxes in the CancelEdit event because some system events cannot be handled in Windows and iGrid may be drawn improperly. 12.The RequestEdit(Optional ByVal iKeyAscii As Integer = 0) method is added. You can put iGrid in edit mode using this method. The iKeyAscii parameter is used to imitate a key press. Alongside with it the CancelEdit method is added. You can cancel cell edit using this method in your program code. 13.The GridLines property is an enumeration now. The GridLines property settings are: igGridLinesNone, igGridLinesVertical, igGridLinesHorizontal, igGridLinesBoth. 14.The MouseDown event has two new parameters - lRow and lCol. These parameters store the row and the column of the cell that has been clicked by the user. 15.Checkbox cells can store values of any type (but not only vbChecked, vbUncheked and vbGrayed as earlier). When the user clicks a checkbox cell, the value of this cell is changed respectively to its value type and checkbox type (two or three states): -if the checkbox has two states and store True or False, these values is changed with each other; -if the checkbox has two states and stores a non-boolean value, this value is converted to the corresponding boolean value and changed like in the previous case; -if the checkbox has three states, the value of the checkbox is converted to vbChecked, vbUncheked or vbGrayed and these values are changed like in the standard VB checkbox. 16.The following function is added: Function FindSearchMatchRow( _ ByVal vSearchCol As Variant, _ ByVal sSearchString As String, _ Optional ByVal lStartRow As Long = -1, _ Optional ByVal bVisibleRowsOnly As Boolean = True, _ Optional ByVal bLoop As Boolean = False _ ) As Long You can perform text search in cells of any iGrid columns using this function. This function searches the first cells in the specified column (vSearchCol) which text is started from the specified character string (sSearchString). The case of the characters is ignored in this function. The function returns the row number of the found cell or zero otherwise. You can also specify the next options in this function: lStartRow - the row start number from which search is started; bVisibleRowsOnly - check only visible rows; bLoop - continue search from the first cell in the column if no matches found from the start row to the last row of the column. 17.Two new boolean properties, KeySearchFromCurRow and KeySearchLoop, have been added. These properties change the behaviour of the grid when the user performs the incremental search. If the first property is turned on, iGrid starts incremental search from the currently selected row; otherwise it starts search from the first row. If the second property is turned on, iGrid continue search from the first cell in the column if no matches found from the start row to the last row of the column. The value of each of the properties equals to False by default. 18.The SelectionChange event from the previous version is divided on two events, CurCellChange and CellSelectionChange. The first event is triggered when the user changes the current cell. The second event is occurs when the selection of any grid cell is changed. The CellSelectionChange has the following syntax: CellSelectionChange(ByVal lRow As Long, ByVal lCol As Long, ByVal bSelected As Boolean). The event is triggered when the selection is set or cleared. The bSelected parameter indicates the new selection state of a grid cell. 19.The ColOrderChanged event from the previous version is replaced by the following two events: -ColHeaderBeginDrag(ByVal lCol As Long, ByRef bCancel As Boolean) This event is raised before the user starts dragging a column header. The bCancel parameter that is passed by reference allows to prohibit column header dragging. All you need to do this is to assign True to this parameter. -ColHeaderEndDrag(ByVal lCol As Long, ByVal lColBefore As Long, ByRef bCancel As Boolean) This event is triggered by the grid when a drag operation has ended on one of its column headers. The lColBefore parameter stores the column number that is placed in the grid just after the dragged column. The bCancel parameter allows to cancel the dragging operation as the same way as in the previous event. 20.The Appearance property has been implemented. This property returns or sets the paint style of the grid on a VB form like the standard VB Appearance property (but the value of this property can be changed also at run-time). 21.The DblClick event has been supplemented by the bRequestEdit parameter. This parameter is used to prohibit editing when the user double clicks the grid. 22.The ComboObject will be supplemented by the following properties/methods: 1) ItemValue(ByVal lIndex As Long) - returns/sets the value of a comboitem. 2) The RemoveItem(ByVal lIndex As Long) allows to remove comboitems. 3) The AddItem method has been supplemented by the lIndex parameter that is used to insert a comboitem before another comboitem. 23.The HighlightSelCells As Boolean property has been added. This property enables the highlighting of the selected cells (True) or disables it (False). In the last case only the current cell (or the current row in row mode) is marked by a focus rectangle if the focus rectangle is turned on. 24.Two new properties, FocusRectColor1 and FocusRectColor2, have been implemented. These properties have the OLE_COLOR data type and define the two colors that is used to draw a focus rectangle. You can create a solid focus rectangle using these properties (if the values of these properties are equal). 25.The CellHatch property of the EHatchStyles type has been implemented. The property allows to specify hatch background for a cell. Another newly created property, OpaqueTextInHatchedCells As Boolean, allows to draw opaque (True) or transparent (False) text in the hatched cells of the grid. 26.The CurRow and CurCol properties can accept a zero value. This value indicates that the grid has no the currently selected cell. 27.The SetCurCell(ByVal lRow As Long, ByVal lCol As Long) method has been added. This method allows to change the currently selected cell in one statement without generating intermediate CurCellChange and CellSelectionChange events which is triggered when you change the value of the CurRow or CurCol property. In addition, you can replace the code like the following With grdCust .Redraw = False .CurRow = 1 .CurCol = 2 .Redraw = True End With on the next statement: grdCust.SetCurCell 1, 2 28.The ColDividerDblClick(ByVal lCol As Long, ByRef bDoDefault As Boolean) event has been implemented. This event is raised when the user double clicks a column header divider. The bDoDefault parameter allows to prohibit the default value for this event (column width auto fit). 29.Three new flags have been implemented for the text cells: igTextBoxNoScrollBars, igTextBoxVScrollBar and igTextBoxHScrollBar. These flags is used to allow vertical and/or horizontal scrollbars in the text editing area. You can combine igTextBoxVScrollBar and igTextBoxHScrollBar flags to enable both scrollbars. 30.The following events has been implemented to trap key press when the user edit text cells: TextEditChange(ByVal lRow As Long, ByVal lCol As Long) TextEditKeyDown(ByVal lRow As Long, ByVal lCol As Long, _ ByVal KeyCode As Integer, ByVal Shift As Integer) TextEditKeyPress(ByVal lRow As Long, ByVal lCol As Long, ByRef KeyAscii As Integer) TextEditKeyUp(ByVal lRow As Long, ByVal lCol As Long, _ ByVal KeyCode As Integer, ByVal Shift As Integer) You can also use the following properties for the text editing area: TextEditText, TextEditSelStart, TextEditSelLength, TexEditSelText. The events and properties mentioned above are identical to the corresponding events and properties of the standard VB TextBox control. 31.Internal data structures and algorithms of the current version of iGrid have been optimized. The amount of the memory required to store iGrid data has decreased in two times due to the optimization. The speed of operations with large amount of data is also significantly increased. Note that the following changes have been made in iGrid during the optimization: 1) The CellTag property has been removed. 2) The CellMaxLength property has been removed. You can use the lMaxLength parameter in the RequestEdit property instead of this removed property. For instance, if you want to restrict user input to 12 characters in the text cells of the "filename" column of the grid named grdThis, write the following code: Private Sub grdThis_RequestEdit( _ ByVal lRow As Long, ByVal lCol As Long, _ ByVal iKeyAscii As Integer, bCancel As Boolean, _ sText As String, lMaxLength As Long) If grdThis.ColKey(lCol) = "filename" Then lMaxLength = 12 End If End Sub All other changes in iGrid limitations are reflected in the Technical Capabilities section of the iGrid 2.0 help file. The lates version of this file can be downloaded from the Download Section of the 10Tec Company Web- site at http://www.10Tec.com/