I have a WPF 4.0 DataGrid with AutoGenerated columns. I would like to only allow the user to edit the first column. Is there an easy way of doing this?
I was trying
The below sample does the trick for one or more columns
private void Grid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
{
if (e.Column.Header.ToString() == "COLUMNNAME")
{
// e.Cancel = true; // For not to include
// e.Column.IsReadOnly = true; // Makes the column as read only
}
}