Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1385
DataGrid with dynamic combo box columns
posted

I'm using WPF XamDataGrid 23.2.157 in a MVVM project.

I want to use a XamDataGrid bound to a DataTable. The DataTable elements are just strings. The tables are dynamic (not known at compile time), and columns can be added/removed.

I want to be able to add columns, and then for each row in each column users select from a set of values (coming from the view model) in a combo box. Every cell should be bound to the same list of options.

I also want to be able to delete columns, preferrably with a delete 'x' in the column header.

I have started by handling FieldLayoutInitialized, but I'm wondering if there is a simple way to do this without handling events?