I have a Kendo grid and in the Create method, I want to do some server side validation and the response I want to show to the user if validation is true or false.
In the below code CreateTLPCurveAllocations is an MVC action method which is having return type as void.
How to use the CreateTLPCurveAllocations method with return type, so that I can show that return value/ message to the user.
@(Html.Kendo().Grid<TLPAllocationDetails>()
.Name("TLPCurveAllocationsGrid") .DataSource(datasource => datasource.Ajax().Read(read => read.Action("GetTLPCurveAllocations", "DataMgmt"))) .Columns(columns => { columns.Bound(p => p.AllocationDate).Editable("EditFieldsForNewRec").Format("{0:MM/dd/yyyy}").Title("Allocation Date").Width(90).HeaderHtmlAttributes(new { style = "justify-content:center" }).HtmlAttributes(new { style = "text-align: right" }); columns.Bound(p => p.CurveDetails).Editable("EditFieldsForNewRec").ClientTemplate("#=getCurveName(data)#").Title("Curve").Width(100).HeaderHtmlAttributes(new { style = "justify-content:center" }).HtmlAttributes(new { style = "text-align: right" }); columns.Bound(p => p.Allocation).Editable("EditAllocation").Title("Allocation").Width(100).HeaderHtmlAttributes(new { style = "justify-content:center" }).HtmlAttributes(new { style = "text-align:right" }); }) .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); }) .HtmlAttributes(new { style = "height: 400px;width:97%" }) .Editable(editable => editable.Mode(GridEditMode.InCell)) .Pageable() .Navigatable() .Filterable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .Batch(true) .PageSize(5) .ServerOperation(false) .Model(model => { model.Id(p => p.AllocationDate); model.Field(p => p.CurveDetails).DefaultValue(ViewData["CurveDetails"] as CurveDetails); }) .Create("CreateTLPCurveAllocations", "DataMgmt") .Update("UpdateTLPCurveAllocations", "DataMgmt") ) )