![]() ![]() Use the event parameter’s OldValue and NewValue properties to get the cell’s original and new value (the value that should be validated). ![]() Subscribe to the DataGridView.ValidateCell event, and implement validation logic in the event handler. If a new cell value does not pass validation, an error message is displayed and the user cannot move focus to another cell until the error is corrected.įollow the steps below to validate cell values: The DataGridView instance is bound to a collection of orders, and its Quantity column allows users to enter positive numbers only. This example shows how to validate a new cell value when a user modified it in an in-place cell editor and moves focus to another cell. The DataGridView allows you to validate new values in in-place cell editors or edit form, indicate errors, and prevent saving invalid data to the data source. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |