As part of a report I have a list of supervisor timeframe data (who supervised between two times). This is certainly not the only data of the report. The whole report is entered and submitted with a single button click.
This supervisor data can be edited in a grid
@Html.LabelFor(m => m.Report.GSupervisors, htmlAttributes: new {@class="form-label"}) @(Html.Kendo().Grid(Model.Report.GSupervisors) .Name("supervisors") .ToolBar(tb => tb.Create()) .Columns(columns => { columns.Bound(p => p.Start).Format("{0:yyyy-MM-dd HH:mm}").Width(240); columns.Bound(p => p.End).Format("{0:yyyy-MM-dd HH:mm}").Width(240); columns.Bound(p => p.Supervisor); }) .Navigatable() .HtmlAttributes(new { @class = "mt-3" }) .Editable(e => e.Enabled(true) .Mode(GridEditMode.InCell) .CreateAt(GridInsertRowPosition.Bottom)) .Selectable(sel => sel.Mode(GridSelectionMode.Single)) )
All three fields are required and Start < End. During editing, the grid correctly creates a red border with an error message if no data is entered in a field when exiting. But still it is possible to have incorrect data (e.g., enter only a Start, but not the other fields). This is caught when the data is submitted and the report is redisplayed with validation errors.
An example of the validation error would have the key Report.GSupervisors[2].Supervisor (see screengrab).
However, the grid does not show what the errors are and which cells contain the errors. I expected the red border around the cells and to see the error message when hovering or entering the cell. This does not happen.
I have found several examples about error handling, but all of them use remote binding. In my case local data binding is used. Also the examples use the OnError event of the datasource to show a popup window, which is really not the way I would like to address this.
How can I achieve the desired error handling?