I got no message validation in red Under the field when I have a dropdownlist in my Grid (batch mode). Only a popup from JavaScript (see attachement)... Any idea?
p.s.: if i remove the dropdownlist (columns.ForeignKey...) for columns.Bound(p => p.NoFormation); the message display correctly (see second attachement).
My model :
Razor :
p.s.: if i remove the dropdownlist (columns.ForeignKey...) for columns.Bound(p => p.NoFormation); the message display correctly (see second attachement).
My model :
[Required(ErrorMessageResourceName = "ValeurRequise", ErrorMessageResourceType = typeof(GlobalesResources))]
public int NoFormation { get; set; }
@(Html.Kendo().Grid<
MesFormations.Models.Employe
>()
.Name("Grid")
.Columns(columns =>
{
columns.ForeignKey(p => p.NoFormation, (System.Collections.IEnumerable)ViewBag.Formations, "Numero", "Description").Title(@MesFormations.Views.Employe.Resources.Titre).Width(240);
columns.Bound(p => p.DateFormation).Width(90).Format("{0:yyyy-MM-dd}").HtmlAttributes(new { style = "text-align:center" });
columns.Bound(p => p.Remarques).Width(230);
columns.Command(command => command.Destroy()).Width(110);
})
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Sortable()
.Scrollable()
.Resizable(resizing => resizing.Columns(true))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("error_handler"))
.Events(events => events.Change("onEdit"))
.Model(model => model.Id(p => p.NoFormationEmploye))
.Create("Editing_Create", "Employe", new { NoEmploye = Model.NoEmploye })
.Read("Editing_Read", "Employe", new { NoEmploye = Model.NoEmploye })
.Update("Editing_Update", "Employe")
.Destroy("Editing_Destroy", "Employe")
)
)