Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Value of chkBox in Grid
Message
From
21/11/2002 18:39:40
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00725392
Message ID:
00725534
Views:
8
This message has been marked as the solution to the initial question of the thread.
>Ok, I think I see what you are saying. I did the following instead:
>
>
>IF m.nKeyCode = 13
>	IF MyGrdTable.wk01 = 0
>            * New line added.
>	    REPLACE MyGrdTable.wk01 WITH 1
>	ELSE
>            * New line added.
>	    REPLACE MyGrdTable.wk01 WITH 0
>	ENDIF
>        * New line added.
>        THISFORM.cmDataManager.Update('MyGrdTable')
>	THIS.PARENT.PARENT.Column4.chkCheckboxCustom1.REFRESH()
>	NODEFAULT
>ELSE
>	DODEFAULT(nKeyCode, nShiftAltCtrl)
>ENDIF
>
Well, thats pretty much what I was suggesting. Update the data directly, rather than the control's value.

>This does the trick, even with the refresh just on the chkBox.

OK. Even better. I thought you could not get it to refresh on the checkbox hence my suggestion but it looks like updating the data source directly has taken care of this aspect. I am not trying this out at all, just guessing <s>.

>Are you saying this takes less overhead, than the Form.Save()?

In this case, most definately.

>If so, is it because the cmDataManager.Update() just updates the cursor passed to it?

More or less. If you stepped through a form.Save, you would see just how much it does which is generally what you want. In this case, that is not want you want. I use cursor.update all the time but sometimes, it is not enough to just use cursor.update. For example, if you made changes to data in a form and then just used cursor.update, then certain form refresh states would not be updated without calling refreshall. This is automatically called by form.save -- so, you just have to get to know the methods a little more intimately and you will find that you dont always have to use a large hammer to crack a small nut.

>You have been a big help on this one... and I am greateful.

No problem.

Best
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform