Handles Me.ColumnChanging

Handles Me.ColumnChanging

am 26.11.2007 07:56:20 von Gabe Garza

Hello all,

I am trying to place validation on my datatables columnChanging event
however the problem I am encountering is that the datasets.columnvalue lags,
that is, the first time the event runs its the old value, the second time
round its the changed value....

Should I be using the columnchanged event instead? or could this be
something to do with my binding source?

Below is my code;

Private Sub me_ColumnChanging(ByVal sender As System.Object, ByVal e As
System.Data.DataColumnChangeEventArgs) Handles Me.ColumnChanging
Dim myErrorValidator As New BL.clsErrorValidatorDataTable
Dim myRow As BL.dsBMS.tblSettingsDefaultsRow

myRow = CType(e.Row, BL.dsBMS.tblSettingsDefaultsRow)
myRow.ClearErrors()
myErrorValidator.Validate_StringEmpty(myRow,
Me.defaultAdminFeePercentageColumn, "Cant be an empty string dude")
myErrorValidator.Validate_DecimalBetween(myRow,
Me.defaultAdminFeePercentageColumn, 0, 1, "Enter a valid percentage value")
myErrorValidator.Validate_StringEmpty(myRow,
Me.defaultMarketingFeePercentageColumn, "Cant be an empty string dude")
myErrorValidator.Validate_DecimalBetween(myRow,
Me.defaultMarketingFeePercentageColumn, 0, 1, "Enter a valid percentage
value")
myErrorValidator.Validate_StringEmpty(myRow,
Me.defaultTeleFeePercentageColumn, "Cant be an empty string dude")
myErrorValidator.Validate_DecimalBetween(myRow,
Me.defaultTeleFeePercentageColumn, 0, 1, "Enter a valid percentage value")
End Sub


Thank you kindly for any ideas
John Sheppard