Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Row-Level Grid Access
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00127777
Message ID:
00127970
Views:
25
>Hi folks:
>
>I am trying to control user-access to a combo-box in a grid.
>
>I have a grid with a column "COMPANY". It contains a Combo-Box, since there are only a few Companies allowed in this field. The field may or may not be filled. There is also an ADD button on the form, so the row may be brand new. The whole form has a SAVE button (it does a TableUpdate()) and an UNDO button (it does a TableRevert()).
>
>Once the User has filled this field and saved it, I want to prevent them from changing it.
>
>I tried testing for the value in the datafile ( if len(trim(GRIDDATA.Company))>0 ) in the Grid1.Column1.Combo1.GotFocus()and setting the combo-box's ENABLED property, but once a field is DISABLED I cannot ENABLE it again.
>
>I also tried doing the same test in the Combo-Box's WHEN method (Return .T. or .F. to control access), but thisseems to only get run the first time the grid is CLICKed. When I click on what should be an editable row, the debugger suggests that it fires the WHEN for the first row and THEN fires the WHEN for the CLICKed row. But it seems to ignore the second WHEN.
>
>
>Can you set access to a field in a grid on a row-by-row basis? If so, how?
>
>Thomas Hirschman

Thomas,
You can't re-enable the combo box because once it's disabled you can't get to the GotFocus() event. I'd use empty(...) rather than len(trim(...))=0, just because it's simpler code, easier to debug.

Finally, I've done similar things using WHEN, I think in the combo box.

Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform