I need a support for ,
I am working on grid custom editing , i want to show success message after successful operation.
How can I do that ? Also If there is any way if we can use inbuild save changes button.
Below is my grid.
Thanks in advance.
@(Html.Kendo().Grid<RVNLMIS.Models.ListMasterBOQResourceCalc>()
.Name("ResourceTypeGrid")
.Columns(columns =>
{
// Resource Type column
columns.Bound(c => c.RsrcType)
.Title("Resource Type")
.ClientTemplate("#= RsrcType ? RsrcType.ResourceTypeName : '' #")
.EditorTemplateName("ClientResource")
.Sortable(false)
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(100)
;
// Resource Name column
columns.Bound(c => c.drpResource)
.Title("Resource")
.ClientTemplate("#= drpResource ? drpResource.ResourceName : ''#")
.EditorTemplateName("ClientSubResources")
.Sortable(false)
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(170);
// Quantity column
columns.Bound(c => c.rsrcQty)
.Title("Quantity")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(70)
.Format("{0:N2}");
// Wastage Percentage column
columns.Bound(c => c.wastagePct)
.Title("Wastage %")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(60);
// Total Quantity column
columns.Bound(c => c.TotalQty)
.Title("Total Qty")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(80)
.Format("{0:N2}");
// Unit column
columns.Bound(c => c.Unit)
.Title("Unit")
.HtmlAttributes(new { style = "text-align:left" })
.HeaderHtmlAttributes(new { style = "text-align:left" })
.Width(60);
// Base Rate column
columns.Bound(c => c.BaseRate)
.Title("Base Rate")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(80)
.Format("{0:N2}");
// Total Rate column
columns.Bound(c => c.TotalRate)
.Title("Resource Amount")
.HtmlAttributes(new { style = "text-align:right" })
.HeaderHtmlAttributes(new { style = "text-align:right" })
.Width(100)
.Format("{0:N2}");
columns.Command(command => command.Destroy()).Width(80);
})
.ToolBar(t =>
{
t.Template(@<text> <b class="ml-2"> Boq Resources Details </b>
@item.CreateButton()
@item.SaveButton()
</text>);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable() // Pagination enabled
.Sortable() // Sorting enabled
.Scrollable() // Scrollable grid
.Events(e => e.Save("onGridSave"))
.HtmlAttributes(new { style = "height:500px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true) // Batch editing
.ServerOperation(false) // Client-side operations
.Model(model =>
{
model.Id(p => p.AutoID); // Set primary key
model.Field(p => p.AutoID).Editable(false); // Disable editing for AutoID
model.Field(p => p.RsrcType).DefaultValue(
ViewData["defaultResourceType"] as RVNLMIS.Controllers.Sub_BOQController.ResourceTypeModel);
model.Field(p => p.drpResource).DefaultValue(new RVNLMIS.Controllers.Sub_BOQController.DrpResourceModel
{
ResourceName = "Select Resource",
ResourceID = 0
});
})
.PageSize(20) // Set page size
.Read(read => read.Action("GetBOQResource_Details", "Sub_BOQ").Data("getBOQId"))
.Create(create => create.Action("EditingCustom_Create", "Sub_BOQ"))
.Update(update => update.Action("EditingCustom_Update", "Sub_BOQ"))
.Destroy(destroy => destroy.Action("EditingCustom_Destroy", "Sub_BOQ"))
)
)