Custom validation of date

M

Mike P

I have 3 dropdowns in my grid view in edit state, representing day,
month and year. I need to validate these controls by trying to parse
the day, month and year together as a valid DateTime. Is it possible to
do this with a Custom Validator?
 
N

Nathan Sokalski

Yes, use the constructor as follows:

Dim x As New Date(2000, 1, 1)

You can do this even after the variable has been declared as follows:

x = New Date(2006, 12, 25)
x = New Date(1981, 4, 20)

For more information on this, see the documentation (the constructor has
overloads). Good Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
VinayKumar Nevatia
Top