Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simulate setfocus in grid.afterrowcolchange method
Message
From
10/04/2003 16:47:29
 
 
To
10/04/2003 15:58:29
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00775732
Message ID:
00776331
Views:
16
Thanks I will try it.

>Hi Claude, I tested this by putting the setfocus in the click of the control in the grid's column and emailed a sample form to you. I cannot post the code because of the limits in DEFINE CLASS with grids and ADD OBJECT.
>
>>>Is nqty a column in the grid? If so, try setting the focus to that column in the grid using grid.column.setfocus. If not, what is the name of the control on the form that holds nqty? Also, remember that the AfterRowColChange event doesn't fire unless the When event nqty returns true (.T.).
>>>
>>>Still, I am confused as to why you would do this. How would you ever edit or step through the grid with this method? Everytime you change columns or rows in the grid it will shift focus to nqty and you would never move through the grid.
>>
>>I did not write the original code, but this is what it does. Grid is read/only and displays a list of issued stock items. Clicking on a line displays the stock number and number of items ordered for the stock number in two text boxes. One of them is the text box for number of items ordered which can be changed and updated. What the original programmer intended (I think) was that when a user clicked on a line the cursor would then move to the text box for items ordered so it could be changed and then update by clicking on an update button. To do this the afterrowcol change method for the grid had the line
>>
>> ThisForm.NQTY.SetFocus()
>>
>>which causes an error. This cause the error message that setfocus is not valid in this method. Not sure why user never noticed this before.
>>
>>Question: is there a way to move the cursor to the desired text box?
>>
>>>
>>>>This has problably been ask and answered but I could not find it.
>>>>
>>>>VFP 7
>>>>
>>>>In a grid on a form there is code in the afterrowcolchange method which had the code
>>>>
>>>> ThisForm.NQTY.SetFocus()
>>>>
>>>>in it (nqty is a field on the form), which is invalid. Is there a way of to move the cursor to that field in the afterrowcolchange method?
Previous
Reply
Map
View

Click here to load this message in the networking platform