Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Calender Control

How can I display links to Previous/Next Year in the Calender Control Title. When I add a calender control into a webform, the title only displays the Month name and links to the Previous and Next month and user needs to click a zillion times to get from 2003 to 1996
Are their any way of doing this easily?
0
henriv
Asked:
henriv
  • 2
1 Solution
 
Nebulus_Commented:
You can add 2 new buttons into form (for inc/dec year):

private void BtnAddYear_Click(object sender, System.EventArgs e) {
Calend.VisibleDate = Calend.VisibleDate.AddMonths(12);
}

private void BtnDelYear_Click(object sender, System.EventArgs e) {
Calend.VisibleDate = Calend.VisibleDate.AddMonths(-12);
}

If you need to have Calendar like design you must make
VisibleTitle of calendar false, add an label into that
must be the month and year and 4 buttons (2 previously
described and another 2 for inc/dec month)

private void BtnAddMonth_Click(object sender, System.EventArgs e) {
Calend.VisibleDate = Calend.VisibleDate.AddMonths(1);
}

private void BtnDelMonth_Click(object sender, System.EventArgs e) {
Calend.VisibleDate = Calend.VisibleDate.AddMonths(-1);
}


I hope this help you
0
 
henrivAuthor Commented:
Brilliant, that did the trick!
0
 
Nebulus_Commented:
If the answer is OK, it's a problem to score this? :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now