How to Commit the AddNewRow value without pressing Enter key in WinRT DataGrid?
In the SfDataGrid, you can programmatically force addnewrow to commit the changes by calling the method, EndEdit of CurrentCellManager and CommitAddNew of AddNewRowController.
C#:
private void CommitAddNewRow(object sender, RoutedEventArgs e)
{
if (this.sfDataGrid.View != null && this.sfDataGrid.View.IsAddingNew)
{
// it commit the entered value in the grid.
if (this.sfDataGrid.SelectionController.CurrentCellManager.CurrentCell.IsEditing)
this.sfDataGrid.SelectionController.CurrentCellManager.EndEdit(true);
var addNewRowController = this.sfDataGrid.GetAddNewRowController();
addNewRowController.CommitAddNew();
}
}Sample Links: