Hi,
I was trying this approach, I used
CommittingNewRow += (s, e) =>
{
if (ItemsSource == null)
return;
bool hasEmptyRows = false;
foreach (var row in ItemsSource)
{
var dataItem = row as CVDataObject;
if (row == null)
return;
var hasNotEmptyValues = false;
//some conditional check for empty rows
hasEmptyRows |= !hasNotEmptyValues;
}
if (hasEmptyRows)
{
CancelEdit();
}
};
The logic is seems to be working, but CancelEdit does not remove the new created row from the datagrid. I`ve also tried to play with RemoveRow(), but got the same result, the row was still there on the screen.