|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Strange behavior data-bound comboboxdropdownlist. Teh combobox is bound to a bindingsource which is in turn bound to a table in my database. The table has only 4 rows and I am using it to display geographical regions - Northeast, Southeast, West, and Central. In the bindingsource AddNew is set to false. Whenever I select an item from the combobox I find that the position in the dropdown list is replaced by the value that was displayed prior to making the new selection. For example when I start the application and view the dropdown list I see the following West Central Southeast Northwest with West being initially displayed in the textbox. If I select Southeast the list changes to the following Southeast Central Southeast Northwest and Southeast is displayed in the textbox. I can no longer select West because it is no longer in the dropdown list !!!! This seems like a bug to me -- or is that how the combobox is supposed to work? I want my list to be immutable. What am I doing wrong? Thanks, Crazy Crazy Cat wrote:
Show quoteHide quote > I am using a data-bound combobox with dropdownstyle set to Sorry to respond to myself but I found the solution and wanted to share> dropdownlist. Teh combobox is bound to a bindingsource which is in turn > bound to a table in my database. The table has only 4 rows and I am > using it to display geographical regions - Northeast, Southeast, West, > and Central. In the bindingsource AddNew is set to false. > > Whenever I select an item from the combobox I find that the position in > the dropdown list is replaced by the value that was displayed prior to > making the new selection. For example when I start the application and > view the dropdown list I see the following > > West > Central > Southeast > Northwest > > with West being initially displayed in the textbox. If I select > Southeast the list changes to the following > > Southeast > Central > Southeast > Northwest > > and Southeast is displayed in the textbox. I can no longer select West > because it is no longer in the dropdown list !!!! > > This seems like a bug to me -- or is that how the combobox is supposed > to work? I want my list to be immutable. > > What am I doing wrong? > > Thanks, > it should anyone run into this problem. The problem was that I had set Data Source and Data Member properties of the data-bound control, without realizing that the Data Set Manager had set the Text property under the Databindings properties (it's easy to miss since the Text property is a sub property of the Databindings and is not visible until you expand Databindings). Anyways once I set the Text subproperty to nothing all was fine. Show quoteHide quote > Crazy Seems like you have bound the "DataSource" property (which only provides the
list of items) and the Text property (which gets and updates a field in a dataset) to the same thing. Just a quick guess. They're supposed to be different.
Are people using data binding now?
what's the difference Function parameter function Upgrading VB2003 to 2005 how to do Binding with code Accessing embedded resources sorting inherited BindingList Adding summary to object browser? VB Project security violation on new Workstation [URGENT] Images and Thumbnail : pb with rendering quality |
|||||||||||||||||||||||