Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two datetimepicker control , datetimepicker1 and datetimepicker2.
i have select the date 24-02-2018 in datetimepicker1, so please tell me how can i set max value for datetimepicker2 which shouldn't be maximum then datetimepicker1 value.

Datetimepicker2 date should always be less than datetimepicker1 value.

What I have tried:

dateTimePicker2.MaxDate = dateTimePicker1.Value;
Posted
Updated 31-Jan-18 22:02pm
Comments
VR Karthikeyan 1-Feb-18 4:02am    
Can you mention what type of UI you are using? Winforms or WPF?

1 solution

Paste Code in DateTimePicker1 ValueChangedEvent

dateTimePicker2.MaxDate = dateTimePicker1.Value;
 
Share this answer
 
Comments
ANKIT JOHRI 1-Feb-18 5:19am    
done thing :) thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900