I've just started using version v2023.2.606 and have a grid with a pop-up editor using an editor template.
This has several required fields (specified in the model), but on opening the window for a new record, the validation error tool tip is shown for the first field (image attached).
This wasn't the behavior in previous versions, which only fired the validation when the update button was clicked. How can I stop this happening?
The grid is:-
@(Html.Kendo().Grid<InformaticsCommissioningHelper.Models.Rule>()
.Name("grid")
.Events(e => e.Edit("onEdit"))
.Columns(columns =>
{
columns.Bound(p => p.ID).Title("ID").Width(120);
columns.Bound(p => p.RunOrder).Title("Order").Width(120);
columns.Bound(p => p.Description).Title("Name").Width(600);
columns.Bound(p => p.LastUpdateDate).Title("Last Updated").Width(150).Format("{0:g}");
columns.Command(command => { command.Edit(); command.Destroy(); });
})
//.ClientDetailTemplateId("subdetailsTemplate")
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable(p => p.Refresh(true))
.Sortable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(m => m.Id(p => p.ID))
.PageSize(15)
.Events(e => e.Error("error"))
.Read(read => read.Action("RD_Rules", "Rules").Data("antiForgery"))
.Create(a => a.Action("InsertRule", "Rules"))
.Update(a => a.Action("UpdateRule", "Rules"))
.Destroy(a => a.Action("DeleteRule", "Rules"))
.Sort(s => s.Add(a => a.RunOrder).Ascending())
)
)
and the template is:-
@model InformaticsCommissioningHelper.Models.Rule
<div style="width:650px;">
@Html.ValidationSummary(true)
@Html.HiddenFor(c => c.ID)
<p>
<span class="lbllabel2">
Name:
</span>
@Html.Kendo().TextBoxFor(model => model.Description).Name("Description").HtmlAttributes(new { style = "width:250px", Maxlength = 75 })
@Html.ValidationMessageFor(model => model.Description)
</p>
<p>
<span class="lbllabel2">
Order:
</span>
<div style="width:150px;" class="float-start">
@Html.Kendo().NumericTextBoxFor(c => c.RunOrder).Spinners(false)
@Html.ValidationMessageFor(model => model.RunOrder)
</div>
</p>
<div style="clear:both"></div>
<p></p>
<p>
<span class="lbllabel2">
SQL:
</span>
@Html.Kendo().TextAreaFor(model => model.RuleSQL).Name("RuleSQL").HtmlAttributes(new { style = "width:470px; font-family:Courier New, Courier, monospace"}).Rows(5)
@Html.ValidationMessageFor(model => model.RuleSQL)
</p>
<p>
<span class="lbllabel2">
Comments:
</span>
@Html.Kendo().TextAreaFor(model => model.Comments).Name("Comments").HtmlAttributes(new { style = "width:470px;"}).Rows(3)
@Html.ValidationMessageFor(model => model.Comments)
</p>