We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridDataBoundGrid with a dataset

What''s the best pratice for catching validation errors that are thrown when you add a new row to the grid that violates a dataset constraint (e.g. field doesn''t allow nulls)? The grid, it seems, handles the exception and presents a friendlier message rather than a raw exception, but I''d like to customize the error message. Thanks!

2 Replies

AD Administrator Syncfusion Team May 24, 2004 03:05 PM UTC

Try handling teh ValiateFailed event, and in your handler set grid.CurrentCell.ErrorMessage. Private Sub GridDataBoundGrid1_ValidateFailed(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridValidateFailedEventArgs) Handles GridDataBoundGrid1.ValidateFailed MessageBox.Show("My Message") e.Handled = True End Sub

AD Administrator Syncfusion Team May 28, 2004 04:44 PM UTC

Thanks for the tip!

Live Chat Icon For mobile
Up arrow icon