Required dropdownlist grid in batch mode

2 posts, 0 answers
  1. Louis
    Louis avatar
    74 posts
    Member since:
    Jun 2011

    Posted 03 Jun 2013 Link to this post

    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 :
    [Required(ErrorMessageResourceName = "ValeurRequise", ErrorMessageResourceType = typeof(GlobalesResources))]
    public int NoFormation { get; set; }
    Razor :
        @(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")
        )
    )


  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 05 Jun 2013 Link to this post

    Hello Louis,

    We are not aware of your exact setup - how come the first column remains empty after skipping the validation? I am not able to reproduce such behavior, could you please modify the attach project and send it back so we can investigate and search for a solution?

    Thank you for the cooperation.

    Kind Regards,
    Petur Subev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top