jauno
  • jauno
  • Member Topic Starter
2018-12-27T18:26:44Z
I want to load a hierachicaly ordered table (rsTree) with approx. 25000 items (directory structure) from a MS-Access recordset to iGrid 6 in tree view style

I do it like this:

Do While Not rsTree.EOF
    p = rsTree.Fields("Pos")
    l = rsTree.Fields("Level")
    D = rsTree.Fields("Dir")
    .CellValue(p, 1) = D
    .RowLevel(p) = l
    .RowTreeButton(p) = igRowTreeButtonHidden
    If lastlevel < l Then
        .RowTreeButton(p - 1) = igRowTreeButtonVisible
    End If
    lastlevel = l
    rsTree.MoveNext
Loop

This takes about 15 minutes.
Is there a way to speed this up?
Igor/10Tec
2018-12-28T07:39:18Z
Do you wrap your code with the BeginUpdate/EndUpdate method calls? Generally this greatly helps to speed up code in which you change a lot of cells.

I may also think about doing this work in the FillFromRS method in the future versions of iGrid. For example, the method may provide an optional parameter to specify the row level field. If it is specified, the corresponding tree view is created.
jauno
  • jauno
  • Member Topic Starter
2018-12-28T14:32:57Z
Originally Posted by: Igor/10Tec 

Do you wrap your code with the BeginUpdate/EndUpdate method calls?


OK. I forgot that method. I tried it with Begin/EndUpdate. Now it takes less than a second. What a difference. Thank you for your support

jauno
  • jauno
  • Member Topic Starter
2018-12-29T20:34:31Z
I have another problem concerning speed while filling iGrid with large datasets (25.000 - 350.000 records in 1 column)
With BeginUpdate/EndUpdate all works very fast in standard mode.
But I have a problem with the visibility of text with font sizes greater then 9, for Rowhights in iGrid are not adapted to fontsizes automatically by default.
I wanted to correct this with iGrid.AutoHightRow(row) whenever a row is been created. But this command although BeginUpdate/EndUpdate implemented slows down the populating process dramatically.
Is there a possibiltiy either to change the RowHeight for all rows in general as preset or another way to adapt the row height to font size without loss of performance while populating the grid?
Igor/10Tec
2018-12-31T09:18:45Z
First, iGrid provides you with a better way to adjust row heights - the AutoHeightRows methods introduced in the v6.5.

Second, if you know that all your cells will display just 1 line of text, you can set the optimal row height before you populate iGrid and forget about this problem at all. The DefaultRowHeight and GetOptimalCellHeight members do this work. Here is an example from the iGrid help file:

With iGrid1
   .BeginUpdate
   .Font.Size = 10
   .DefaultRowHeight = .GetOptimalCellHeight()
   .ColCount = 3
   .RowCount = 100
   ...
End With