G
Guest
Hey all,
I was wondering if there was a different way of coding the following snippet.
I have a bound datagrid and I'm using the ErrorProvider to catch errors.
So if I have many fields to validate I just pack them in that procedure? One
if on top of another? Is there something cleaner?
Private Sub m_dt_ColumnChanging(ByVal sender As Object, ByVal e As
System.Data.DataColumnChangeEventArgs) Handles m_dt.ColumnChanging
If e.Column.ColumnName = "LNRSTN" Then
If e.ProposedValue = String.Empty Then
e.Row.SetColumnError(e.Column.ColumnName, "You can't do that")
Else
'e.Row.SetColumnError("LNRSTN", "")
e.Row.ClearErrors()
End If
End If
End Sub
I was wondering if there was a different way of coding the following snippet.
I have a bound datagrid and I'm using the ErrorProvider to catch errors.
So if I have many fields to validate I just pack them in that procedure? One
if on top of another? Is there something cleaner?
Private Sub m_dt_ColumnChanging(ByVal sender As Object, ByVal e As
System.Data.DataColumnChangeEventArgs) Handles m_dt.ColumnChanging
If e.Column.ColumnName = "LNRSTN" Then
If e.ProposedValue = String.Empty Then
e.Row.SetColumnError(e.Column.ColumnName, "You can't do that")
Else
'e.Row.SetColumnError("LNRSTN", "")
e.Row.ClearErrors()
End If
End If
End Sub