views:

652

answers:

1

I would like to be able to add / remove columns to my datagrid, based on UI inputs from the user.

Is this possible? Any good articles on this?

Thanks, Mark

A: 

Yes it is possible:

// Candidates is the DataGrid

var newColumn = new DataGridTextColumn() { Header="New Column"};
Candidates.Columns.Add(newColumn);
Candidates.Columns.Remove(newColumn);
Michael S. Scherotter
This seems to work, but I'm always "one click behind". I suspect this is something to do with the updates not being updated on the UI Thread?
Mark Cooper