0

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

Mark Cooper
  • 6,738
  • 5
  • 54
  • 92

1 Answers1

0

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
  • 10,715
  • 3
  • 34
  • 57
  • 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 Jun 11 '09 at 14:04