外部キー列を使用するインライン編集グリッドがあります。foreignKey.cshtml に、オプション ラベル (「選択してください」) も追加します。
ビュー:
columns.ForeignKey(p => p.EmployeeID, (System.Collections.IEnumerable)ViewData["testStatus"], "EmployeeID", "EmployeeName");
モデル:
[Required(ErrorMessage = "Required")]
[DisplayName("Employee ")]
[UIHint("GridForeignKey")]
public int EmployeeID { get; set; }
共有/GridForeignKey.cshtml
@(
Html.Kendo().DropDownList()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(""))
.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
.OptionLabel("Select value")
)
私の質問は、ユーザーが「選択してください」オプションを選択し、必要なメッセージを表示するかどうかを検証する方法です。ありがとうございました
ありがとうございました