Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid & DropDown Listbox enable / disable
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Grid & DropDown Listbox enable / disable
Miscellaneous
Thread ID:
00577689
Message ID:
00577689
Views:
70
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
Peter Pirker


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

(Woody Allen)
Next
Reply
Map
View

Click here to load this message in the networking platform