Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid & DropDown Listbox enable / disable
Message
 
 
To
05/11/2001 18:08:54
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00577689
Message ID:
00577780
Views:
20
>Hi Mike,
>
>See, I avoided the surname this time, that way I don't get into trouble :-))
>
>I thought I might as well get it from the horses mouth, so here's the problem:
>
>Assume a grid with a dropdown listbox fed with values from an array, sparse=.t., from which the user may choose one of two values. Once saved, if it's "VALUE1", it may not be changed.
>
>So, in the before RowColChange or in the AfterRowColChange, or both for that matter, goes the code:
>
>
>IF THIS.Column1.DropDown1.Value="VALUE1" AND RECNO("MyTable")< 0
>   *// Optimistic buffering
>   THIS.Column1.DropDown1.ENABLED=.F.
>ELSE
>   THIS.Column1.DropDown1.ENABLED=.T.
>ENDIF
>
>
>Nothing to it, right?
>Except it does not happen, and no amount of refreshing the listbox or the whole grid for that matter will do it. You have to move away form the record with the disabled listbox to one that would potentially enable and then to another field on that record before it's enabled.
>
>This was an issue with VFP 6.0 and apparently still is an issue with VFP 7.0
>
>Any hints, tips tricks & other workarounds are welcome, and I'd be glad to throw in a code sample if you tell where to ship it.
>
>TIA

You can set column.ReadOnly property
column.ReadOnly=myTable.myField="VALUE1"
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