Private Sub UcdgvAuxiliary_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles UcdgvAuxiliary.CellValidating
If UcdgvAuxiliary.Columns(UcdgvAuxiliary.CurrentCell.ColumnIndex).Name = "StartDate" AndAlso UcdgvAuxiliary.CurrentCell.IsInEditMode = True Then
If Not UcdgvAuxiliary.EditingControl Is Nothing Then
If Not UcdgvAuxiliary.EditingControl.Text = "" Then
Dim ss As String = System.Text.RegularExpressions.Regex.Replace(UcdgvAuxiliary.EditingControl.Text, "^(((0[1-9][12]\d3[01])\/(0[13578]1[02])\/((1[6-9][2-9]\d)\d{2}))((0[1-9][12]\d30)\/(0[13456789]1[012])\/((1[6-9][2-9]\d)\d{2}))((0[1-9]1\d2[0-8])\/02\/((1[6-9][2-9]\d)\d{2}))(29\/02\/((1[6-9][2-9]\d)(0[48][2468][048][13579][26])((16[2468][048][3579][26])00))))$", "")
UcdgvAuxiliary.CurrentCell.Value = ss
UcdgvAuxiliary.EndEdit()
End If
End If
End If
End Sub
Wednesday, May 13, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment