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: 695
  • Last Modified:

Selecting and deselecting dates in Asp.net calendarendar

Hello experts,


I need some code to prevent the selection of already selected dates, and allow the selection of dates that have not yet been selected in Asp.net calendar.

Thanks
0
adamtrask
Asked:
adamtrask
  • 3
1 Solution
 
Kumaraswamy RCommented:
HI

ssigned the selected dates back based from the list values at SelectionChanged event

http://geekswithblogs.net/dotNETvinz/archive/2009/03/09/tiptrick-aspnet-calendar-control-with-multiple-date-selections.aspx
0
 
adamtraskAuthor Commented:
Thanks rkworlds: for your response.

I actually use a generic Dictionary to store  dates with color and text assigned to the selected e.cell.

My idea is to prevent the user from mistakenly selecting a new date that is already selected.

This would cause an error in the Dictionary and the database since the item.key would not be unique.

Thanks
0
 
adamtraskAuthor Commented:
Thanks.... I believe I found what I needed:

 If e.Day.IsSelected = True Then
            e.Day.IsSelectable = False
        Else
            e.Day.IsSelectable = True
        End If
0
 
adamtraskAuthor Commented:
My reason for accepting my own comment as the solution are.

I posted the question yesterday morning and didn't get the right response.

In the meantime I've been playing around with code until I got the right answer.

Thanks all the same
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

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