Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to refresh a grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00340043
Message ID:
00340328
Views:
23
Albert,
I do it with the 'DynamicBackColor' property:

a) Add a property to the form called 'nRecno'

b) In the Grid AfterRowColumnChange store the active record number to thisform.nRecno, then refresh the grid

c) In the Grid INIT() set the DynamicBackColor:
thisform.Grid1.SetAll("DynamicBackColor",    "IIF(recno()<>thisform.inrecno, RGB(255,255,255) , RGB(0,255,0))", "Column")
Setting the color this way lets it 'stay' when you change focus out of the grid.

HTH
Barbara



>I have a grid that is tied to a view. And then I have a textbox that the user enters a name to search. After they press Search on a related button, I would like the view to be requeried with the possible matches showing in the grid.
>
>More exactly, the view takes just the first letter of the entered name and requeries on that eg. if I entered Gaston in the textbox, the method just grabs the G and rebuilds the list on that. Then, I search the cursor for the closest match and what I want to do is to highlight the grid row with that match so that if there is 300 records returned, the best available match is highlighted.
>
>I also really want the focus to stay on the textbox, not the grid but I am not sure how to do that and to have the highlighted row continue to be another colour (I used to be able to do it in FPW26 via a SHOW GET m.jnNameList and then I would put the focus back onto my text box via STORE OBJNUM(m.jcSearchName) TO _CurObj.
>
>I did this in VFP but an wondering if there is another way:
>
>THISFORM.grdNamesFound.Refresh()
>THISFORM.grdNamesFound.SetFocus()
>THISFORM.txtSearchName.SetFocus()
>
>but then if I put the focus back on the text box, the grid loses it's colour (which could be a VMPro prob, not VFP). But maybe there is another way to do this that is better.
>
>Albert
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform