Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know a ListItem in ComboBox is disabled?
Message
From
22/08/2019 10:50:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/08/2019 10:10:06
Joe Kaufman
Bell Laboratories Inc.
Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01670243
Message ID:
01670248
Views:
85
IMHO, not adding the disabled ones in the first place is a better approach.

You didn't tell us how you are populating the combobox. SQL rowsourcetype might be a good choice.

>Hello,
>
>I have a ComboBox that I am populating with a mix of enabled and disabled items (need to keep the disabled items so old data can display properly). When adding a new record, I want to make sure disabled items cannot be selected.
>
>Appending "\]" to the front of the combo's Value grays out the items just like I want, and such items can not be clicked on with the mouse nor selected by arrowing through the items via keyboard (they are skipped). So far, so good.
>
>The problem is that this ComboBox is actually a subclass where I have added "SmartSearch" capability. When the user types character, the value auto selects to match what they have typed so far (like smart searches in more modern controls). I do the search by a straight check of list item DisplayValues, and cannot tell if the item is disabled. The "\]" that told FoxPro to disable the list item is long gone, and I cannot see any other property or method that can tell me a certain list item is part of a disabled row.
>
>Is there some way to know I am about to select an item that is disabled so I can make sure it is disallowed? Hope I am being clear about what I am running into, and much advanced gratitude to anyone who can help!
>
>Thanks,
>Joe Kaufman
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform