Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Way to update only the changed row grid color
Message
From
07/08/2009 15:30:59
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01416806
Message ID:
01416829
Views:
45
>>>I have SetAll in .init already and that's fine for when I load the form, but I want to set the color myself for just the row the user updates.
>>>Actually the user has focus on a textbox where they use a barcode scanner to input a value, then I want to locate the row and change the color of that row. The criteria would be the same but the scope really only needs to be that one record at that point.
>>
>>Your code should evaluate new form property, e.g. gridrecno. In Grid.BeforeRowColumnChange you will set this property:
>>
>>Thisform.gridrecno=recno(this.recordsource)
>>
>>and in Grid.AfterRowColumnChange you will check if grid.refresh is required,
>>
>>If Thisform.gridrecno=recno(this.recordsource)
>>  return
>>endif
>>This.Refresh
>>
>>DynamicColor expressions should evaluate if Thisform.gridrecno=recno('gridsourcealias'). By the way, you don't need to include long expressions there. You may just have form's method called, e.g.
>>
>>This.Column1.DynamicBackColor="0+thisform.setgridcolor()"
>>
>>The first thing in Setgridcolor would be checking Thisform.gridrecno.
>
>Should you assign Column.BackColor here instead?
>
>Nice idea, BTW.

Form's method will return value used in DynamicBackColor expression. It is very old trick created on UT more than 10 years ago.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform