Sep 28th, 2013, 12:43 PM
How to bind combobox in datagrid header?
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!
Click Here to Expand Forum to Full Width
Survey posted by VBForums.