I have a need to fire the validation event on the grid, when nothing is pending editing.
A full example:
- User is allowed to input and save any amount of data in a grid. They can commit this to database any number of times, with any number of cell values missing.
- Eventually they need to hit an approve button on a popup window. I need the validation of the grid's datasource to be fired at this point, and show any failed validations. At this point, its possible that there is no "pending" edits in the grid, but we need to make sure everything in the grid is filled in/passes validation.
How do I fire the grid validation event, when I have nothing currently editing, or what would you suggest.?
Hello Charles,
>>validation of the grid's datasource to be fired
Your scenario is unclear. The validation mechanism is related to editors; a dataSource does not support validation. If a user did not edit grid data, how may invalid data appear in your dataSource? Does your database contain invalid data and you want to check it using dxDataGrid? If so, what should happen if there is invalid data in your database? How dxDataGrid should handle this? If your database has a large amount of invalid data, should your administrator correct this data every day manually?
So, your scenario sounds confusing to me. I suggest you implement validation at the editor's level and not allow users to post invalid data into your database.
The user can potentially spend days filling out the grid and saving it, as they figure out what information they need, until its ready for approval. We render these fields on a data grid on the popup.
An example: A user want to fill out a person on a grid, and they fill out the first name, and last name, but don't know the birthday yet, we would let them save the first and last name in the grid. On save of the grid, we would save the first name and last name to the database, and null the birthday out. We don't care about the fact that birthday is null yet. This person's status is considered "in progress".
But if we want them to approve this person (IE push an approve button), the grid needs to have the birthday filled out. The backend will also validate this so that the database will properly have all the fields filled in on "approval", but I ideally would like the grid to fire the validation as well. Mostly so we can highlight the cell that is missing data. I pondered triggering the edit event of each row in the grid in code just so the validator fires, but prefer not to go down that route if possible