Reputation: 841
Is it possible to allow a user to add and edit column names for a DataGrid in the same way they can add rows? The DataGrid is bound to a collection of ExpandoObject, so it should be theoretically possible to dynamically add and modify the keys.
If it can't be done with the current DataGrid control, what would be the best way to create a grid control where the columns can be modified?
Upvotes: 1
Views: 447
Reputation: 23935
Fiddly..Unfortunately the columns are not bindable. To get around this (as I have the need for dynamic columns in the grid) I derive from the grid add methods to add and remove columns and rename the columns that exist. The user interaction is the hardest the grid will happily add and remove columns at runtime, you just add and remove them from the columns collection.
Upvotes: 1