c# - Combo Box Data Binding -


hopefully has seen before , can see mistake:

i binding combo box selected value data set , first time change combo box selected value, not update in data set i.e. values don't match. if change selected value second time works expected , data set updates match combo box.

i using second data set data source populates list of items text (for user) provides index save in first data set.

combobox.databindings.add(new system.windows.forms.binding("selectedvalue", dataview1, "mode", true)); combobox.datasource = dataview2; combobox.displaymember = "list_str.str_text"; combobox.valuemember = "list_str.index";             

any idea why data set not update first time selected value changes?

edit: may not have been clear i'm not binding directly data set - using data view since have multiple tables in data set. possible use data view automatically save data set? should close , open new question?

try combobox.selectedindexchanged instead.

http://devpinoy.org/blogs/joeycalisay/archive/2005/11/23/combobox-selectedindexchanged-vs-selectionchangecommitted.aspx

selectedindexchanged * raised when datasource set * raised when selectedindex set programmatically

selectionchangecommitted * not raised when datasource set * not raised when selectedindex set programmatically


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -