Hi,
I'm using a variation of the following code from MSDN in my VB.NET 2005 Express app. I have conditions that are being met, and can display a message box to prove to myself that its reaching that point, but I'm not getting an ErrorProvider exclamation mark now that I've formatted the columns in my DataGridView to be numeric. Before formatting them, the error icon displays perfectly.
The MSDN Code (from http://msdn2.microsoft.com/en-us/library/0ye0dkkw.aspx) is:
Why would formatting my columns break the ability to display the icon?
I'm using a variation of the following code from MSDN in my VB.NET 2005 Express app. I have conditions that are being met, and can display a message box to prove to myself that its reaching that point, but I'm not getting an ErrorProvider exclamation mark now that I've formatted the columns in my DataGridView to be numeric. Before formatting them, the error icon displays perfectly.
The MSDN Code (from http://msdn2.microsoft.com/en-us/library/0ye0dkkw.aspx) is:
VB.NET:
Private Sub Customers_ColumnChanging(ByVal sender As Object, _
ByVal e As System.Data.DataColumnChangeEventArgs)
' Only check for errors in the Product column
If (e.Column.ColumnName.Equals("Product")) Then
' Do not allow "Automobile" as a product.
If CType(e.ProposedValue, String) = "Automobile" Then
Dim badValue As Object = e.ProposedValue
e.ProposedValue = "Bad Data"
e.Row.RowError = "The Product column contians an error"
e.Row.SetColumnError(e.Column, "Product cannot be " & _
CType(badValue, String))
End If
End If
End Sub
Why would formatting my columns break the ability to display the icon?