Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up the grid
Message
From
15/10/2001 11:06:46
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00568452
Message ID:
00568536
Views:
14
Hi Vlad,

Yeah, would you please tell me the way to change the backcolor of rows without refreshing the whole grid? I'd like to learn about it.

About my program, I have two tables, TableOne as the main table and TableTwo with relations to TableOne..

My grid has 12 columns, first 7 showing data from TableOne, but not the first 7 fields. 8-9 showing data from TableTwo, 10-12 also showing data from TableOne, but is using iif(,,) to select the correct value.

Then, I use set filter to type=="xx" to show the records I want.

And in the afterrowcolchange, i have:
LPARAMETERS nColIndex
nGridRecNo = this.activeRow
this.SetAll('DynamicBackColor', "iif(nGridRecNo==this.activerow,";
     +allt(str(RGB(0,200,200)))+ "," + allt(str(this.BackColor));
     + ")",'Column')
this.refresh
There also some more codes but I think it doesn't matter.. such as
set cursor on in when event, set cursor off in valid event..

without the code in afterrowcolchange, the speed is quite ok, but with the code, the refresh rate is very poor.. what do you think?

Jimi

>Hi!
>
>Yes, there is a way to refresh the back color of the line without call of the Grid.Refresh, but the approach is somewhat complex and is not tested in the live environment in production. If you want, I can describe it, but it has also disadvantage - while speed of rows refreshing is better when you navigate them, as soon as the entire grid is refreshed, it bocemes slightly slower than with usuall approach. This is because you will need to use custom method call from DynamicBackColor expression instead of using iif() function. The slow down is little, however, compare to how it could be slow when refreshing the entire grid with filtered recordset.
>
>You're right, it is better to use views instead of filtered table.
>
>If you want, I can look to your code and tell you which parts cause slow down and how to change them to speed up the forms.
>
>
>>hi all,
>>
>>filtering the table on a grid would slower the process, switching to views instead of tables makes it better. But then, I have to put a dynamicbackcolor on the afterrowcolchange event to give the users a "listbox feel".
>>
>>This makes the program very slow, the refresh rate is very significant. Is it possible to change the backcolor of 2 rows (jumping from 1 row to another), without refreshing the whole grid? Or are there any other way to set the color in a faster way?
>>
>>sigh, always have speeding problems in my program :-\
>>
>>Thanks in advance!
>>Jimi
error(503): file structure failure, signature file corrupted.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform