472,145 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Calendar Date Block

I am trying to block certain dates in the calendar to be Selectable. I have been able to do this for weekends ..


If e.Day.IsWeekend Then
e.Day.IsSelectable = False


But I am not able to figure out a way to get weekends.

But I do know a round about way to do this..


If e.Day.Date.Day = Convert.ToDate(d, HolidayList.SelectedItem.Text) And e.Day.Date.Month = Convert.ToDate(m, HolidayList.SelectedItem.Text) Then
e.Day.IsSelectable = False


While this could work, is there an easier way out?
Oct 3 '07 #1
1 1527
3,406 Expert 2GB

That's about the best way I can think of. for weekend you can use the weekDay() function which should return a number (if I remember right, it's been a while) 1-7 or 0-6 and you could block out certain numbers, but this doesn't save you much in terms of programming space or processor time.

Oct 4 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by cg_news | last post: by
19 posts views Thread by Stimp | last post: by
5 posts views Thread by Don | last post: by
3 posts views Thread by thorpk | last post: by
12 posts views Thread by Geoff Berrow | last post: by
1 post views Thread by swethak | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.