MVC 验证属性 Kendo 网格不适用于 UIHint

MVC Validation Attributes Kendo Grid don't work with UIHint

在我的模型中我有

    [Required(ErrorMessage = "BIC Code is required")]
    [RegularExpression("^[a-zA-Z0-9]{11}$",ErrorMessage = "11 alphanumeric characters expected")]
    [UIHint("BicCode")]
    public string BicCode { get; set; } 

BicCode对应的Template

@model string  
@(Html.Kendo().MaskedTextBox().Name("BicCode").Mask("AAAAAAAAAAA") )

在我的 kendo 网格版本中,除了使用 UIHint 的属性之外,我的所有验证属性都被使用了。

如何处理 UIHint 验证和 Kendo 网格?

正如史蒂夫格林在他的评论中所建议的那样。

使用 MaskedTextBoxFor(m => m) 而不是 MaskedTextBox() 解决了我的问题。