Hi Graham,
Thank you for using Syncfusion products.
Your requirement to add new record to invisible column in “CurrentRecordContextChange” event can be achieved by using “EndEditCalled” action instead of "BeginEdit Complete" because begin action will occur at Before record editing and use “DataSourceControlRowAdding” event which is used to handle “AddNewRecord“. Please refer the following snippet:
[code behind C#]
void GridGroupingControl1_DataSourceControlRowAdding(object sender, Syncfusion.Web.UI.WebControls.Grid.Grouping.GridDataSourceControlRowAddingEventArgs e)
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Script","alert('ID value added')",true);
e.Handled = true;
e.Cancel = true;
}
void GridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{
if (e.Record != null)
if (e.Record.Kind == Syncfusion.Grouping.DisplayElementKind.AddNewRecord && e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditCalled)
{
e.Table.AddNewRecord.SetValue("ID", 3);
}
}
For your convenience, we have created the following sample and the sample it can be download from below link:
ColumnWidth-GridWeb-903128158.zipPlease let us know if any concerns.
Regards,
Yogesh R