Hello,
I need add validationRules for dropdownList in grid dialogtemplate.
I found similar but for ASP.NET MVC here: https://www.syncfusion.com/forums/139118/editmode-dialogtemplate-with-ejdropdownlist-validation
<td style="text-align: left">
@Html.EJ().DropDownListFor(o => o.EmployeeID, (Syncfusion.JavaScript.Models.DropDownListProperties)ViewBag.ddl).DropDownListFields(o=>o.Text("id").Value("id")).ValidationRules(v=>v.AddRule("required", true))
</td>
I have:
<ejs-dropdownlist width="200" id="EmployeeID" dataSource="@ViewBag.Employees" filtering="onfiltering" placeholder="Wybierz Pracownika" allowFiltering="true" filterBarPlaceholder="Wyszukaj"
headerTemplate="@Html.Raw("<div class=\"header\"> Imię i Nazwisko</span></div>)")"
itemTemplate="@Html.Raw("<div class=\"name\"> ${Name} ${Surname} </div>")"
valueTemplate="@Html.Raw("<div class=\"name\"> ${Name} ${Surname} </div>")"
value="@ViewBag.selectedEmployees">
<e-dropdownlist-fields validationRules="@(new { required=true})" text="EmployeeID" value="EmployeeID"></e-dropdownlist-fields>
</ejs-dropdownlist>
I need to validate if dropdownlist is selected from list. Default is null. I want to prevent close dialog if dropdownlist is not selected.
Flag validationRules don't work here.
In Grid when i add:
<e-grid-column validationRules="@(new { required=true})" allowEditing="false" field="EmployeeID" width="80" headerText="EmployeeID" visible="false"></e-grid-column>
don't work too. Works only for input text.