general ideas for using a calendar control to set availability

Posted on 2008-11-17
Last Modified: 2012-05-05
I am after some general advice.

I have a calendar control and wanted a user to be able to click on cells of the month and change the background colour of the cell to set different types of availability for that day, so on first click would change to red to show booked etc, then when they hit save i would do a check on the background colour and save the status to the database.

it seems there is no onclick event for a day of a calendar so am after alternate ways to allow the user to set availability status for a particular day.

does anyone have any ideas, is there a "normal" way of doing this?
Question by:scm0sml
    LVL 3

    Accepted Solution

    An alternative to your approach would be to use a calendar in conjunction with a dropdownlist of the available statuses.
    On the calendar you can use the ondaycreated event to override the background colour to illustrate availability. Use onselecteddatechanged to select the date and choose the correct status from the dropdown. The dropdown selectedindexchanged event be used to alter the availability data and cause the calendar to redraw.

    Beyond this I think you are in to the realms of custom controls in every date on the calendar... e.g. changing every date in the calendar to a button which itself has an onclick which toggles availability for its date.

    Author Comment

    i have got my date ranges selected now so will have a dropdown to allow the user to select the status for the selected date range then set the background colour of the cell based on the value of the dropdown.

    Author Closing Comment

    we are getting there :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now