This is a migrated thread and some comments may be shown as answers.

Required dropdownlist grid in batch mode

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Louis asked on 03 Jun 2013, 04:41 PM
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")
    )
)


1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 05 Jun 2013, 01:35 PM
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!
Tags
Grid
Asked by
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Petur Subev
Telerik team
Share this question
or