Try handling TableControlCurrentCellChanged and add the valuse at that point. Also handle TableControlCurrentCellMoved to reset a bool flag that makes sure you only add the values once. Here are handlers that you can add to the above sample (you also need to subscribe to the two events.)
private bool addedValuesInNewRow = false;
private void gridGroupingControl1_TableControlCurrentCellMoved(object sender, GridTableControlCurrentCellMovedEventArgs e)
{
if(e.TableControl.CurrentCell.MoveToRowIndex != e.TableControl.CurrentCell.MoveFromRowIndex)
addedValuesInNewRow = false;
}
private void gridGroupingControl1_TableControlCurrentCellChanged(object sender, GridTableControlEventArgs e)
{
if(this.gridGroupingControl1.Table.AddNewRecord.IsEditing && !addedValuesInNewRow)
{
this.gridGroupingControl1.Table.AddNewRecord.SetValue("Col2", r.Next(1000));
this.gridGroupingControl1.Table.AddNewRecord.SetValue("Col3", r.Next(1000));
this.gridGroupingControl1.Refresh();
addedValuesInNewRow = true;
}
}