We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to get index of a newly added row to fill custom values to specific columns.

Is there a way to fill values programmatically based on an X column (value is used to get info from the API and fill to their respective columns) on the newly added row in batch mode?

Or a way to add values to a specific column in the grid on the newly added row(in batch mode not yet saved.)

1 Reply

SP Sarveswaran Palani Syncfusion Team February 15, 2023 01:01 PM UTC

Hi Royland,

Greetings from Syncfusion support.

From your query, we suspect that in batch edit mode you want to change the column value based on another column value. We have prepared sample based on your requirement. Kindly refer the attached code snippet and shared sample for your reference.

<SfGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">

    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"> </GridEditSettings>

<GridColumn Field=@nameof(Order.FinalCost) HeaderText="Final price" Format="C2" TextAlign="TextAlign.Center" Width="120">


//you can customize value based on your requirement

                    var value = (context as Order);

                    var finalAmount = value.ManfCost + value.LabCost;





Please get back to us if you have any question or concern.


Attachment: SfGrid_ValueChange_d70f4779.zip

Live Chat Icon For mobile
Up arrow icon