Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
IgxGrid Validate All Rows
posted

I'm working on an editable grid that the user can add rows to. I'm trying to validate that a newly added row doesn't already exist with the same values somewhere else in the grid. I have a row validator that checks all the rows and will put the new row into an error state if a duplicate is found.

The problem that I can't seem to find a solution for is if the user goes to the already existing row and makes changes to fix the error, the new row that was invalid cannot be revalidated to clear the error.

I tried to prevent leaving the new row by canceling the `rowEdit` event, but canceling removes the row entirely. It's odd.

Is there a way to have the grid run the validation for all rows and all cells?

Thank you.

Parents
  • 2680
    Offline posted

    Hello Joshua,

    Thank you for posting to Infragistics Community!

    I have been looking into your question and I am wondering if you are leveraging the Grid Editing and Validation functionality to implement validation in this case? This is a relatively new feature introduced in our library since version 14.1.0. With it, the validation mechanism is triggered when editing both cells and rows. This leaves me under the impression that the validation on your side might be implemented by other, possibly custom approaches. Please, let me know if my assumptions are incorrect and do elaborate further in that case.

    So, what I can suggest is checking out the built-in grid validation features. Additionally, unique validator is not among the supported out-of-the-box, however custom validators could also be set, as described in this section. As an example, please check out this StackBlitz demo, where a custom “unique values” validator is implemented and applied to the “ProductName” field.

    In conclusion, please, check out the referenced resources and let me know if you need any further assistance on the matter.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

Reply Children