Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox in grid clears grid - on {Enter} only
Message
 
 
To
22/03/2010 09:44:51
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01456045
Message ID:
01456086
Views:
98
This message has been marked as the solution to the initial question of the thread.
My question is - do you have a button on this form that fires its Click method by pressing Enter (Default property of this button set to true).

This whole code in ARCC seems like a big kludge solving this strange anomaly you can not figure out the cause.

Alternatively, do you have a KeyPress event of the grid or form that may contribute to this behavior?

>I'm not sure what you're asking?
>
>In the meantime I believe I've solved the problem by changing the AfterRowColChange method to this:
>
>
>LPARAMETERS nColIndex
>LOCAL i AS INTEGER, cAlias AS STRING
>
>* I've always felt that the grid control is a bit temperamental and found that setting the controlsource to itself 
>* stabilizes it.  
>
>cAlias = ALIAS()    && added now
>TRY
>   WITH THIS
>      SELECT(.RECORDSOURCE)   && added now
>      .nActiveRow 			= .ACTIVEROW
>      .LastActiveCell[1,1] 	= .ACTIVEROW
>      .LastActiveCell[1,2] 	= .ACTIVECOLUMN
>      .lLastRow = .ACTIVEROW= RECCOUNT(.RECORDSOURCE)
>      FOR i = 1 TO .COLUMNCOUNT
>         .COLUMNS(i).CONTROLSOURCE = .COLUMNS(i).CONTROLSOURCE
>      ENDFOR
>      .REFRESH
>   ENDWITH
>CATCH TO oEx
>   oEx = NULL
>ENDTRY
>
>* added next three lines now although I'm not sure they are needed as long as ALIAS() is not empty.
>IF cAlias <> ''
>   SELECT (cAlias)
>ENDIF
>
>
>
>I'd appreciate your comments, if any.
>
>TIA
>
>Peter
>
>>>Hi Naomi,
>>>
>>>Thank's. Maybe your approach is the sounder one, although I can't offhand say why. I'll certainly give it a try.
>>>
>>>As to the try...catch, my thinking was that, if the replace, for whatever reason, were to cause an error, I don't want the whole app to fail.
>>>
>>>In the meantime I've narrowed the issue down: the enter on the checkbox for some reason causes the grids columncount to be set to zero. Why, I don't know.
>>>
>>Do you have a button on your form with Default property set to true?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform