C1TrueDBGrid displays a message for any errors that occur when building a project. You must switch off the internal error handling.
Complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub C1TrueDBGrid1_Error(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.ErrorEventArgs) Handles C1TrueDBGrid1.Error e.Handled = True End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void c1TrueDBGrid1_Error(object sender, C1.Win.C1TrueDBGrid.ErrorEventArgs e) { e.Handled = true; } |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub C1TrueDBGrid1_Error(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.ErrorEventArgs) Handles C1TrueDBGrid1.Error If C1TrueDBGrid1.Columns(C1TrueDBGrid1.Col).DataField = "CategoryID" Then e.Handled = True MessageBox.Show("Your User Friendly Message") Else e.Handled = False MessageBox.Show("Enter a string") End If End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void c1TrueDBGrid1_Error(object sender, C1.Win.C1TrueDBGrid.ErrorEventArgs e) { if (c1TrueDBGrid1.Columns[c1TrueDBGrid1.Col].DataField == "CategoryID") { e.Handled = true; MessageBox.Show("Your User Friendly Message"); } else { e.Handled = false; MessageBox.Show("Enter a string"); } } |