Click here to Skip to main content
15,666,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am developing application using data grid view in c sharp.

Two fields as follows;

Start week date End week date
(Datepicker) (Datepicker)

for example

Start Week Date End Week date
18th Monday choose in date picker 23rd Saturday.

when i choose the 18th Monday in the end week date 23rd Saturday automatically want to display.

and another condition in the datepicker starting date always to be monday.
[no name] 5-Jan-13 5:30am    
you need to search it to google.

1 solution

Set the start week to the monday.

//This will work on load event of form
dtm_end_week.Value = dtm_start_week.Value.AddDays(6);

//This will work on selecting dtm_start_week .
private void dtm_start_week_MouseEnter(object sender, EventArgs e)
            dtm_end_week.Value = dtm_start_week.Value.AddDays(6);


Share this answer

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