Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox in grid clears grid - on {Enter} only
Message
From
22/03/2010 09:44:51
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01456045
Message ID:
01456081
Views:
43
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?
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform