I am needing to change my combo.valuemember during run-time depending on certain user interaction.
The combo datasource is an ultradatasource with 5 columns. Is it OK to be changing the combo.valuemember during run-time? I am switching between two columns (One column is decimal and the other is string). Would this effect the combo.displaymember?
The reason I am asking is because when I switch the valuemember, the combobox is not displaying the column I have set in the combo.displaymember. It is displaying another column.
any ideas?
Hi,
You probably have to change the Value, as well.
If the ValueMember is a string column, then then Value of the combo is going to be a string. When you change the ValueMember to a decimal column, the current Value of the combo (a string) will not match up to any of the items on the list.
So you probably need to store the value of the decimal column in the current SelectedRow, then change the ValueMember, then set the Value.