Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 161267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:10:59+00:00 2026-05-11T11:10:59+00:00

I have code to do multiple selections in a calendar control but I would

  • 0

I have code to do multiple selections in a calendar control but I would like to change the color of the initially selected day to green and the end date to red. Visually this would indicate the start date and end date of a certain service to be provided. Should I be looking into RenderControl Method for my calander or more looking into setting some attribute of the days in the control?

The multiple select code is attributable to Steve Wellins

protected void Calendar1_SelectionChanged(object sender, EventArgs e)     {         System.Web.UI.WebControls.Calendar TheCalendar = sender as System.Web.UI.WebControls.Calendar;          // create new list of dates or get stored list of dates         List SelectedDates;          if (ViewState['SelectedDates'] == null)             SelectedDates = new List();         else             SelectedDates = ViewState['SelectedDates'] as List;          // if date is already in list, remove it, otherwise, add it         if (SelectedDates.Contains(TheCalendar.SelectedDate) == false)             SelectedDates.Add(Calendar1.SelectedDate);         else             SelectedDates.Remove(Calendar1.SelectedDate);          // set the calendar to our list of dates         TheCalendar.SelectedDates.Clear();         foreach (DateTime Date in SelectedDates)             TheCalendar.SelectedDates.Add(Date);          // store list for next postback         ViewState['SelectedDates'] = SelectedDates;     } 

This code may overwrite any date or formatting applied to the calendar but I am not above saving and restoring this formating to the calendar.


foreach (DateTime Date in SelectedDates)                 TheCalendar.SelectedDates.Add(Date); 

I am glad to research leads if you point me down the right path or terms to search for.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:10:59+00:00Added an answer on May 11, 2026 at 11:10 am

    From the MSDN site the Calendar..::.OnDayRender Method is invoked while each day is being rendered. I am a .NET noob… how to use it all?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 303k
  • Answers 303k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Do you mean to change it to using a param… May 13, 2026 at 8:42 pm
  • Editorial Team
    Editorial Team added an answer On Windows Vista (and Windows 7), Dns.GetHostEntry also returns IPv6… May 13, 2026 at 8:42 pm
  • Editorial Team
    Editorial Team added an answer If you want to get the value after the hash… May 13, 2026 at 8:42 pm

Related Questions

I am writing a form in Word 2003 to collect multiple responses to a
I’m on the learning curve up the Silverlight trail. I’m a data-centric developer so
I've been having a problem creating a checklist in the style of the TouchCells
I have a document-based Core Data app. My main Core Data entity has several

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.