My app has a datagrid with comboboxes in the datagridheaders, one for each column. It is bound to a datatable object.
I am looking for a way to enforce a 2 way binding between the selectedvalue in the combobox and the viewmodel. My idea was to bind the selected string for each combobox to the caption property of the datagridcolumn. Then I can set the selected value of the combobox programmatically from the viewmodel simply by manipulating the datatable, and whenthe user select a diffrent value inthe combobox I can read that value from the caption property.
Is there a better way? And how do I set up this binding? I have tried lots of different binding expressions but got lots of errors?
Oh, the number of columns in the datagrid is dynamic, but that shouldn't pose a problem.
Please help me out here!