Display alert message if KendoGrid End (To) Date is greater than Start (From) Date in ASP.Net MVC

mahesh213
 
on Sep 22, 2021 10:55 PM
473 Views

Hi,

I have 2 dates LicenceFrom Date and Todate.

my requirement is that Todate is greater than from date.

if i am going to select todate if it's greater than from date then display alert message 

can you please help me in following code 

@{
    Layout = null;
}
 
@using AspProject.Models; 
@using Kendo.Mvc.UI; 
@(Html.Kendo().Grid<License>()
      .Name("inlineGrid")
      .Columns(columns =>
      {
          columns.Bound(p => p.LicenseId).Width(20).Hidden().HeaderHtmlAttributes(new { @title = "License" }); 
          columns.Bound(p => p.LicenceName).Width(20).Width(300);
          columns.Bound(p => p.LicenceFromDate).Width(200).EditorTemplateName("DatePicker");
          columns.Bound(p => p.LicenceToDate).Width(200).EditorTemplateName("DatePicker");
          columns.Command(p => p.Edit().Text("Edit").HtmlAttributes(new { @title = "Edit" })).Width(220);
      })
      .ToolBar(toolbar => toolbar.Create().Text("Add").HtmlAttributes(new { @title = "Add" }))
      .Editable(editable => editable.Mode(GridEditMode.InLine))
      .Pageable()
      .DataSource(dataSource => dataSource
          .Ajax()
          .Model(model => model.Id(p => p.LicenseId))
              .Read(read => read.Action("Read", "Home").Type(HttpVerbs.Post))
              .Update(update => update.Action("Update", "Home").Type(HttpVerbs.Post))
          )
)

DatePicker

@model DateTime?

@(Html.Kendo().DatePickerFor(m=>m)

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download