Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with grid and enabling/disabling field
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00139711
Message ID:
00139718
Views:
21
Control the ReadOnly property of the column from the GotFocus() event of the spinner.

>I'm using a grid in a form that is populated from a cursor. One of the columns contains a spinner control that I want to enable or disable based on the value of a corresponding logical field in the cursor. To do this, I've put code into the grid's AfterRowColChange event - e.g. thisform.grid1.column1.spinner1.enabled = cursor.logical. This code is only triggered if the record # of the cursor changes (i.e. a row change, not a column change).
>
>This works fine for disabling the spinner, however, it gets stuck in an odd way when it's time to enable the spinner. If the focus is on a disabled line of the cursor and you click on the spinner control of a line that should be enabled, the AfterRowColChange event does get triggered, and the spinner is set to being enabled, however it still behaves as if it is disabled. This only happens if you click directly onto the spinner from a disabled row. If you click on a different column in the new row to be enabled and then over to the spinner, it behaves fine. Also, if you clicked on the spinner initially, then click over to a different column in the same row, and then back to the spinner, it works fine. This is not, however, an acceptable way to require a user to interact with this.
>
>There seems to be some link with the problem and the fact that the control is a spinner. I have used a regular field and it works fine. Needless to say, this problem has me stumped and I'd appreciate any helpful comments.
>
> Thanks,
>Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform