Perform validation across multiple cells during Save in Batch Edit and show errors in the cells

Hello Syncfusion Team,

I am using the Syncfusion Blazor DataGrid in batch edit mode and need to implement cross-cell validation (across rows, within the same column) with the following requirements:

1. Immediate cell-level validation during edit (already working via custom validator).

2. Cross-cell validation during Save: If multiple cells fail validation, all must be highlighted and show error tooltips (this is important).

3. Block Save and navigation if validation fails and ideally scroll to the first invalid cell.

This is an important requirement for my project. Without robust cell-level cross-validation, it is very hard to justify using Syncfusion for our use case.



Business Scenario

For each model, my grid displays two rows: "Time" and "Value".

Rule: If a user enters a value in the Time row for a given column (AM/PM), the corresponding Value row for that column must also have a value (and vice versa).

If one is filled, both are required.


What I Want

- When the user clicks Save, all invalid cells should be highlighted with error tooltips, just like per-cell validation.

- Navigation should be blocked until all errors are fixed, and the grid should scroll to the first error.

- I do not want to show validation errors in a toast or dialog, as this is not user-friendly for large grids.


What I Have Tried (and Workaround)

- Immediate cell-level validation is handled in a custom validator (works fine).

- On Save, I merge batch changes and run cross-cell validation logic.

- If errors are found, I try to set validation errors on the cells using a method like:

    public void SetValidationError(GridRowViewModelV2 row, string fieldName, string message)
    {
        var fieldIdentifier = new FieldIdentifier(row, fieldName);
        messageStore.Add(fieldIdentifier, message);
        context.ShowValidationMessage(fieldName, false, message);
    }

However, this doesn't work correctly because the `FieldIdentifier` is created with a different row instance (from merged batch data), the error message cannot be cleared by the cell-level validator when the user edits the cell later. This leaves the cell in a broken state.

If this issue can be solved, this problem can be solved altogether.

- (Workaround) I just used the error messages from cross-cell validation logic in a toast notification and block save but this is a hacky approach that our business unit rejected.


Minimal Repro

https://blazorplayground.syncfusion.com/VNrIjvNbtiVkgpNo

Thank you for your help!


5 Replies

AK Ashish Khanal August 8, 2025 12:31 AM UTC



AK Ashish Khanal August 8, 2025 07:05 PM UTC

This is such a basic thing in batch edit and I'm quite surprised this is not provided out of the box in Syncfusion Grid.

This issue will block us from using Syncfusion in newer projects in the future, so please either implement this natively or provide a viable workaround with good UX.


I need a workaround like this:

  • User enters values freely with individual cell validation working (this already works)
  • When user hits "Save", collect all the cross-cell validation errors (I've already implemented this in the Save method)
  • What workaround I want from Syncfusion at this time:
    • When user hits "Save", collect all the grid cell locations (using column and row indexes) where the error occurred (do this programmatically with custom logic)
    • Highlight those cells with error message in the cell's tooltip (do this programmatically with custom logic)
    • Scroll to the errored-out cells and focus on the first errored out cell (do this programmatically with custom logic)
    • When user enters correct value in the cell, clear the error message and error highlighting (do this programmatically with custom logic)



PS Prathap Senthil Syncfusion Team August 11, 2025 08:01 AM UTC

Hi Ashish,


Based on your latest request, it is not possible to provide a workaround to validate or edit different columns in different rows simultaneously. The grid only has access to the data in the row currently being edited, so cross-row validation cannot be implemented. We do have plans to work around editing the same column in next  row, but editing different columns in different rows at the same time is not feasible. Therefore, a workaround solution to achieve this, as per your requirement, is unfortunately not possible at this time.Thank you for your understanding.

Regards,

Prathap S



AK Ashish Khanal August 11, 2025 10:01 PM UTC

Hi Prathap,

I understand that currently you don't have supported way of doing this out of the box.

That's the reason why I asked for a workaround.


Are you saying we can't do these steps? Because these look pretty standard C# stuffs with a bit of Syncfusion specific things.

  • When user hits "Save", collect all the grid cell locations (using column and row indexes) where the error occurred (do this programmatically with custom logic). Can you give me the reason why this can't be done?
  • Highlight those cells with error message in the cell's tooltip (do this programmatically with custom logic). Even a bit of css might help here.  Can you give me the reason why this can't be done?
  • Scroll to the errored-out cells and focus on the first errored out cell (do this programmatically with custom logic). Can you give me the reason why this can't be done?
  • When user enters correct value in the cell, clear the error message and error highlighting (do this programmatically with custom logic).  Can you give me the reason why this can't be done?


GR Guhanathan Ramanathan Syncfusion Team August 12, 2025 02:57 PM UTC

Hi ,


We have updated the details in the ticket created under your account. Please refer to it for further updates.

Regards,

Guhanathan  


Loader.
Up arrow icon