Hello
I'm trying to use Remote validation, but it doesn't work in Grid.
Here are my view model and Grid definitions. Remote validation for the UserName property should check whether username exists. This validation works fine in other places, but not in the Grid and not in the edit forms loaded via Ajax call.
public class GridItemViewModel
{
public string Id { get; set; }
[Required]
public string LastName { get; set; }
[Required]
[Remote(nameof(UsersController.IsValidUsername), "Users", ErrorMessage = "Username exists")]
public string UserName { get; set; }
}
@(Html.EJ().Grid<GridItemViewModel>("Users")
.Datasource(Model.DataSource)
.Columns(cb =>
{
cb.Field(m => m.Id).IsPrimaryKey(true).Visible(false).Add();
cb.Field(m => m.LastName).Add();
cb.Field(m => m.UserName).Add();
})
.EditSettings(e => e.AllowAdding(true).AllowDeleting(true).AllowEditing(true)
.EditMode(EditMode.Normal))
.ToolbarSettings(ts => ts.ShowToolbar(true)
.ToolbarItems(tbi =>
{
tbi.AddTool(ToolBarItems.Add);
tbi.AddTool(ToolBarItems.Edit);
tbi.AddTool(ToolBarItems.Update);
tbi.AddTool(ToolBarItems.Cancel);
}))
)
Screenshot shows that the LastName property is properly validated, but the UserName is not.

I tried with the various EditModes, but it's all the same.
Is it possible to remote validate a property in the grid, using any Edit mode?