@code {
private List
private void OnRowInserting(DataGridCommandEventArgs e)
{
    // Add the new item to the list
    Data.Add(e.Item);
    // Call RowInserted
    e.RowState.RowInserted( Data.IndexOf( e.Item ), e.Item );
    // Cancel editing mode
    e.Cancel();
}
 
}