>>>> In other words we are talking about new values that the user adds, he >>>> just wants to be able to see them after he adds them. >>>> For this to work, the only things that need to be done is to add user as >>>> a ValueMode option and to have it save the value on LostFocus when the >>>> ValueMode is user. >>>> >>> Yes you would otherwise be using a textbox for free-form textual entry, so >>> you want >>> to populate the Choices with ["A", "B", "C"] but allow *any* textual entry. >>> >> Which is what dComboBox does right now. >> > Ok, I see now that it does do this, if AppendOnEnter is True. I was under the > impression (I don't use dComboBox anywhere currently) that it wasn't going to > allow > anything different than what was already in the Choices, and I was wrong. > > > >>> I agree >>> that Dabo's dComboBox should support such usage out of the box, without >>> raising >>> 'string must be present in the choices'. >>> >> I disagree. List controls simply do not work that way, and trying to >> munge the data binding code to accommodate a use case that is better served >> by alternative approaches is a bad idea. >> >> Here's another approach: make a composite control with a dTextBox and a >> dBitmapButton. The text box is bound to the column, and the button (with a >> down triangle image, as in a combo box) brings up a context menu with the >> A,B,C options. If a user selects one of the options, it populates the >> textbox and the column. >> >> So rather than mess with the data binding concept and design, build a >> custom control with the behavior that is needed. >> > As a user, I would expect that if I entered a value that wasn't in the > choices, that > that value would now be one of the choices. > > Sim, how about resetting the Choices list to your three choices, plus > whatever the > Value is currently, upon requery() or RowNumChanged? > > Paul > I don't want to add the value to the drop down list. I want it to be a text box with a drop down list of popular suggestions, which are listed in a table. In the ComboBox there is a UserValue, which does exactly what I want. However, you cannot set a ValueMode of User. Because of this, the database won't show or save values that are not in the list. When I extended the class to allow a ValueMode of user it worked like a charm.
I expect a combobox to be used as a hybrid of textbox and dropdown list so that I have a choice of how I want to use it. I can set it with keys, and then the key will get saved to the database, in which case the current functionality works great, or I can use it without keys, in which case I want any string that I type in to be saved and read from the database. In other words, a combobox should give me the choice of using it as either more then a dropdown or more then a textbox. In other words, I don't want to break the current functionality, I want to enhance it so it works like comboboxes in many other programming environments, including MSAccess, which is what I am converting this application from. Sim _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
