Binding a Combo with Fixed Values - It can't be that complex surely!!
Posted on 2004-12-01
I have a combo which I need to populate with fixed values (e.g. OK,Yes,No etc..) and bind to a column in a table, which just happens to be displayed in a datagrid on the same form. Because the values are fixed, I figured it should be the same as binding a textbox object, it's just that the user doesn't have to type in the values, they can select them from the list (or so I thought). I added a textbox and bound that and it works fine. I added the combo, populated it but it doesn't change the values. It will show changes if I enter them via the text box.
1) Go to grid row 1, Data column (one I need to change) is '*' by default. Change this with combo to 'Yes', move off row 1 nothing changes.
2) Go back to grid row 1, change data column using textbox to 'Yes', cell in grid changes to 'Yes', combo changes to 'Yes', move off row and return and both textbox and combo show 'Yes'.
So the combo will show the data correctly, but cannot change the data.
I had posted this problem before but had to move onto another project before a solution could be found.