Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
jauno  
#1 Posted : Thursday, December 27, 2018 10:26:44 AM(UTC)
jauno

Rank: Member

Groups: Registered
Joined: 10/22/2015(UTC)
Posts: 27
Location: Alsace, France

Thanks: 7 times
Was thanked: 1 time(s) in 1 post(s)
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:

Code:
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?

Edited by moderator Thursday, December 27, 2018 11:35:49 PM(UTC)  | Reason: Igor/10Tec added code formatting

Igor/10Tec  
#2 Posted : Thursday, December 27, 2018 11:39:18 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,015

Thanks: 14 times
Was thanked: 130 time(s) in 130 post(s)
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  
#3 Posted : Friday, December 28, 2018 6:32:57 AM(UTC)
jauno

Rank: Member

Groups: Registered
Joined: 10/22/2015(UTC)
Posts: 27
Location: Alsace, France

Thanks: 7 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Igor/10Tec Go to Quoted Post
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  
#4 Posted : Saturday, December 29, 2018 12:34:31 PM(UTC)
jauno

Rank: Member

Groups: Registered
Joined: 10/22/2015(UTC)
Posts: 27
Location: Alsace, France

Thanks: 7 times
Was thanked: 1 time(s) in 1 post(s)
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?

Edited by user Saturday, December 29, 2018 12:35:56 PM(UTC)  | Reason: Not specified

Igor/10Tec  
#5 Posted : Monday, December 31, 2018 1:18:45 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,015

Thanks: 14 times
Was thanked: 130 time(s) in 130 post(s)
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:

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

thanks 1 user thanked Igor/10Tec for this useful post.
jauno on 12/31/2018(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.