-1

I have two controls in my application. The first one displays the current date and the second one displays the +7 days from the current date and which is also readonly.

My Problem is when I change the date of the first date control, the second one should show the +7 days from the selected date. I am not able to perform this.

I am trying this below statement:

dtcToDate.Value=(dtcFromDate.DateValue)+7;
Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164

1 Answers1

0

Use the AddDays() method.

DateTime currentDate = DateTime.Now;
DateTime newDate = currentDate.AddDays(7);
Rahul Vijay Dawda
  • 1,123
  • 3
  • 14
  • 36