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_ColumnChan ging(ByVal sender As Object, ByVal e As
System.Data.Dat aColumnChangeEv entArgs) Handles m_dt.ColumnChan ging
If e.Column.Column Name = "LNRSTN" Then
If e.ProposedValue = String.Empty Then
e.Row.SetColumn Error(e.Column. ColumnName, "You can't do that")
Else
'e.Row.SetColum nError("LNRSTN" , "")
e.Row.ClearErro rs()
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_ColumnChan ging(ByVal sender As Object, ByVal e As
System.Data.Dat aColumnChangeEv entArgs) Handles m_dt.ColumnChan ging
If e.Column.Column Name = "LNRSTN" Then
If e.ProposedValue = String.Empty Then
e.Row.SetColumn Error(e.Column. ColumnName, "You can't do that")
Else
'e.Row.SetColum nError("LNRSTN" , "")
e.Row.ClearErro rs()
End If
End If
End Sub
Comment