Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why combox-items are not disabled using '\' in rowsource

Status
Not open for further replies.

Nifrabar

Programmer
Joined
Mar 16, 2003
Messages
1,343
Location
NL
Hi,
I'd like to disable items in a combobox so I used underlisted view.
I expected once tAdressen.koppel=.T. the field achternaam will be \achternaam. And indeed that happens.
Than Igave the combobox this view as rowsource. But the items which '\' still are enabled.
Do I oversee some ?

*****************************************************
SELECT Tadressen.voornamen, Tadressen.roepnaam, Tadressen.tussennaam,;
IIF(Tadressen.koppel,"\"+Tadressen.achternaam,Tadressen.achternaam) AS achternaam,;
Tadressen.adressoort, Tadressen.id, Tadressen.bstraat,;
Tadressen.bhuisnum, Tadressen.bhuislet, Tadressen.bpostcode,;
Tadressen.bplaats;
FROM ;
db_dekenaat!tadressen;
WHERE Tadressen.adressoort = ( 1 )
******************************************************

-Bart
 
It appears that the "disabling" option doesn'y apply to Alias and/or Query - it does work for arrays and list items (I didn't try the other options.) In fact, I just thought to check the Hacker's Guide and it says:
With RowSourceType set to 0, 1, or 5, you can disable an item in the list by preceding it with a backslash ("\"). To show an item beginning with a backslash, you need to use two backslashes.
Rick
 
OK Rick,
Thanks. I did not know that and will modify my code for this reason.
-Bart
 
Well I just ran into this myself... I'm a little unhappy (ok I'm a lto unhappy) that adding a backslash to the beginning of a field's value does not disable the item in the combobox as expected. I wonder why it was done this way and whether MS has any plans to fix this? Anyone know whether this behavior is changed in VFP 8 or VFP 9...could check it myself, but figure maybe someone else already knows.

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
Craig,
No, this remains the same - at least as far as I can tell. I believe it's once again due to the legacy of Fox and backward compatibilty requirements. You've got to understand that VFP's combo box is really a number of controls all wrapped up into one, and you'll NEVER see that kind of flexibility in VB or .NET! So sometimes you have to live with the restrictions, OR change the data into another format that does support the '\ for disabled' format.

Rick


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top