Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: Allow adding only one new row in C1DataGrid

$
0
0

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.


Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>