Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00584131
Message ID:
00584608
Views:
33
Thanks again Jim. I understood the first part. It's just that the next time I come to that record I would need to add it to the list for the binding to work and when superuser makes changes and the list needs to be rebuilt as well. Just wondering if the not binding option would simplify matters but at the stage I'm at now in the app it's pretty much six of one, half dozen of the other.

Thanx again.

>>Thanks for the explanation Jim. Could you please ellaborate and/or give an example of what you mean for, "do your own data binding in the LostFocus and GotFocus of the combo and forget about the ControlSource property" because the behaviour you describe is what I'm after -- Allow the user to choose from the list or enter a value but the new value is not added to the list. This is because the users want to be able to enter what they want but the "master" list can only be updated by a superuser.
>
>Colin,
>
>By add to the list I am referring to the internal list of the combobox not the list that that comes from. For example;
>
>
>* ComboBox Valid
>IF This.Value <> This.DisplayValue
>   * Add item to combo
>   This.AddListItem( ... )
>ENDIF
>
>
>This will cause the internal list of the combo to have the value that the user typed in only until the combo is destroyed. When the form is next loaded the combo will again only contain the items in the "master" list. Your added item is only temporary to allow the default data binding to work.
>
>If you want ot use your own data binding, here's how I do it.
>
>I add a property to my combobox class named cUpdateField. In this property I put the name of the field to be bound to the combobox. In the class's GotFocus I set the DisplayValue for the combo to the contents of the UpdateField and in the LostFocus I set the Updatefield to the DisplayValue of the combobox. Something like;
>
>
>* Combo GotFocus
>lcField = This.UpdateField
>This.DisplayValue = &lcField
>
>
>
>* Combo LostFocus
>REPLACE (this.UpdateField) WITH This.DisplayValue
>
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Reply
Map
View

Click here to load this message in the networking platform