In my wpf datagrid I have implemented validation using IDataErrorInfo
. When there is a error in a cell, cells in other rows become ReadOnly. To me this makes sense, but business wants to be able to change other row cells without fixing the error i.e. in some scenarios let users make a mess and, poor developer's life miserable.
I have tried resetting HasCellValidationError
to false but it did not fix it. I'll very highly appreciate any feedback/suggestion on this issue.
BindingFlags bf = BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Instance;
PropertyInfo inf = myDataGrid.GetType().GetProperty("HasCellValidationError", bf);
if (inf != null)
{
inf.SetValue(myDataGrid, false, null);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…