Ed Leafe wrote: > On Jan 11, 2010, at 8:13 AM, Paul McNett wrote: > >>> 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 _______________________________________________ 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]
