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


general ideas for using a calendar control to set availability

Posted on 2008-11-17
Medium Priority
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
  • 2

Accepted Solution

RusselR earned 2000 total points
ID: 22974503
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

ID: 22974905
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

ID: 31517397
we are getting there :)

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Loops Section Overview
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

577 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