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

Issue with foreign key dropdown validation messages

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
LUCIAN GOGONEA
Top achievements
Rank 1
LUCIAN GOGONEA asked on 29 Oct 2015, 06:33 PM

We are experiencing an issue with our MVC SiteFinity application. When editing a grid inline having a foreign key dropdown column set as the first column displayed in the grid its necessary to click the grid confirm button twice to display all validation messages when the row ​has no data entered. The first click displays the validation message for the foreign key dropdown column and the second click then displays all subsequent column validation messages. The css code listed below is used to prevent another issue that was causing the validation message tool-tip for the dropdown foreign key column to be displayed underneath the subsequent row of the grid. If the foreign key dropdown column is not set as the first column in the grid on click of the confirm button then the validation messages all get displayed correctly when no data is entered.

// Gridview
<div class="row" id="divGridApplicationStatuts" style="padding-top: 0px;">
      @(Html.Kendo().Grid<SitefinityWebApp.Mvc.Models.TypeActiviteReglementModel>()
           .Name("GridTypeActiviteReglements")
           .Columns(columns =>
           {
              columns.Bound(p => p.Id).Title("No.").Width(25).Filterable(false).Sortable(true);
              columns.ForeignKey(p => p.BeneficierId, (System.Collections.IEnumerable)ViewBag.Beneficiers, dataFieldValue: "BeneficierId", dataFieldText: "BeneficierName").Title("Bénéficier").Width(85).Filterable(true).Sortable(true).EditorTemplateName("TypesActivitesReglementsBeneficierEditor");
              columns.Bound(p => p.Nom).Title("Type d'activité").Width(300).Filterable(false).Sortable(true);
              columns.Command(command =>
              {
                  command.Edit().Text("Éditer").UpdateText("Confirmer").CancelText("Annuler").HtmlAttributes(new { style = "padding:3px" });
                          command.Destroy().Text("Supprimer").HtmlAttributes(new { style = "padding:3px" });
              }).Width(90);
              })
             .ToolBar(toolbar => toolbar.Create().Text("Ajouter"))
             .Scrollable(scr => scr.Height(570))
             .Sortable()
             .Pageable()
             .Filterable()
             .Editable(editable => editable.Mode(GridEditMode.InLine))
             .HtmlAttributes(new { style = "width:1048px" })
             .Events(ev => ev.Edit("onEdit").Save("onSave"))
             .DataSource(dataSource => dataSource
                     .Ajax()
                     .AutoSync(false)
                     .Events(e => e.RequestEnd("onRequestEnd"))
               .Model(model =>
               {
                   model.Id(p => p.Id);
               })
               .Sort(s => s.Add("Id").Ascending())
               .PageSize(12)
               .Events(events => events.Error("error"))
               .Read(read => read.Url("/tar/TypesActivitesReglements/TypesActivitesReglementsRead").Data("sendAntiForgeryToken"))
               .Create(create => create.Url("/tar/TypesActivitesReglements/TypesActivitesReglementsCreate").Data("sendAntiForgeryToken"))
               .Update(update => update.Url("/tar/TypesActivitesReglements/TypesActivitesReglementsUpdate").Data("sendAntiForgeryToken"))
               .Destroy(destroy => destroy.Url("/tar/TypesActivitesReglements/TypesActivitesReglementsDestroy").Data("sendAntiForgeryToken"))
               .ServerOperation(true)
               )
               )
</div>
 
// Dropdown foreign key template
 
@(Html.Kendo().DropDownListFor(model => model)       
    .OptionLabel("- Sélectionnez - ")
    .Name("BeneficierList")
    .DataValueField("BeneficierId")
    .DataTextField("BeneficierName")
    .BindTo((IEnumerable)ViewBag.Beneficiers)
      )
 
// Style fix
<style>
    .k-tooltip {
        /*height: 25px;*/
        position: static;
        white-space: normal;
    }
 
    .k-tooltip-validation .k-invalid-msg {
        display: block;
    }
 
    .k-invalid-msg .k-callout {
        display: block;
    }
</style>

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 03 Nov 2015, 12:17 PM
Hi Lucian,

I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please modify the attached demo in order to reproduce the issue and send it back to us? This would help us pinpoint the exact reason for this behavior.


Regards,
Vladimir Iliev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
LUCIAN GOGONEA
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or