General information
Category:
Forms & Form designer
Title:
Best way to refresh a grid
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only