Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling input on one row of a grid
Message
From
03/07/1997 13:02:08
 
 
To
03/07/1997 11:15:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00038531
Message ID:
00038558
Views:
47
>I know I should be able to figure this out on my own...brainlock again...
>
>I have a grid whose record source is a view of a table containing billing records. The grid columns contain text boxes and option groups. If the value in the date_billed column is empty, the item has not been billed and the user should be allowed to change values in all the other columns for that record. If there's a value in date_billed, the bill has been sent and user cannot edit anything in that record. The user should get a dialog box explaining why the record cannot be edited.
>
>My question is, where to put the code to test for the value in date_billed, and what properties to set to disable editing in that row? I've experimented with code in the InteractiveChange method of each control, but that seems like too much code and the results are not exactly what I want. (For example, setting the readonly of a text box to true works fine--it affects only the current record-- but there is no readonly property for an optiongroup, and enabled = .f. affects all the rows.)
>
>Is there something I can do at the grid level? Something tells me that I should use the AfterRowColChange event to test the value of date_billed, but I'm unsure what properties to set.
>
>Sorry for the long description. Thanks,
>
>Ross

I guess this is case for DynamicCurrentControl property. For example you put two different option group (enabled/disabled) into appropriate column and toggle them automatically depending on DynamicCurrentControl expression which evaluates date_billed value. You can look at DynamicBackColor example from 'Knowledge Base' to get hints how to use Dynamic properties in general.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform