<button class="btn btn-primary" @onclick="BatchSaveMethod">Batch Save</button>
|
Thanks for the example, now everything is clear to me.
Best Regards.
I am not using editmode = batch. We don't provide EditMode property.
How can I set value of that cell. I have already foun RowIndex.
Hi Amish,
Based on your requirements, we suggest using the Grid public method SetCellValueAsync
to achieve your goal. Please refer to the code snippet below for your
reference.
@using Syncfusion.Blazor.Grids
<button id="SetCellValue" @onclick="DataHandler">SetCellValue</button> <SfGrid DataSource="@Orders" @ref="grid" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })"> <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings>
<GridColumns> <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn> <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn> <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn> <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn> </GridColumns> </SfGrid>
@code {
public List<Order> Orders { get; set; }
protected override void OnInitialized() { Orders = GetAllRecords(); } SfGrid<Order> grid; private async Task DataHandler() { await grid.SetCellValueAsync(1005, "CustomerID", "UpdatedCell"); }
|
Regards,
Prathap S