I unable to validate the dropdownlist if the user select "Please select" value when the update button is clicked
I have inline editing grid implementing foreign key column. In the foreignKey.cshtml i also add the option label ("Please select").
View in grid:
columns.ForeignKey(p => p.EmployeeID, (System.Collections.IEnumerable)ViewData["testStatus"], "EmployeeID", "EmployeeName");
//Model:
[Required(ErrorMessage = "Required")]
[DisplayName("Employee ")]
[UIHint("GridForeignKey")]
public int EmployeeID { get; set; }
//Shared/GridForeignKey.cshtml
@(
Html.Kendo().DropDownList()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(""))
.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
.OptionLabel("Select value")
)
I have inline editing grid implementing foreign key column. In the foreignKey.cshtml i also add the option label ("Please select").
View in grid:
columns.ForeignKey(p => p.EmployeeID, (System.Collections.IEnumerable)ViewData["testStatus"], "EmployeeID", "EmployeeName");
//Model:
[Required(ErrorMessage = "Required")]
[DisplayName("Employee ")]
[UIHint("GridForeignKey")]
public int EmployeeID { get; set; }
//Shared/GridForeignKey.cshtml
@(
Html.Kendo().DropDownList()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(""))
.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
.OptionLabel("Select value")
)