Can I have only a single row of a WPF DataGrid editable?
datagrid, editing, wpf, wpfdatagrid
Solution
Got it, I'm just canceling out of the edit of any row other than the first one.
private void dataGridStats_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
{
if (e.Row.GetIndex() != 0)
{
e.Cancel = true;
}
}
Problem
I have a data set that I want to display to the user, but I only want them to be able to edit the newest (first) row of data. I need to display the other rows of data to them for reference. I don’t have to keep everything in the same DataGrid but would like to if possible. I’m new to WPF so any help/ideas are greatly appreciated!