Solved

Working with calendar selections

Posted on 2006-10-25
2
177 Views
Last Modified: 2010-04-16
I am looking for some help with the calendar control in .NET 2.0, I am writing in c# and using a for each to loop over a DataSet to retrieve a list of dates in a database. I am trying to show the selected dates in the calendar. But I am not having a lot of luck. I found an example online, but it doesn't seem to be what I am looking for.

I wouild appreciate some pointers or references on how this is done. Thanks in advance
CJSantora

This is a portion of the code I am currently using:


    protected void CalDayRender(object sender, DayRenderEventArgs e)
    {
        CalendarDay d = ((DayRenderEventArgs)e).Day;
        TableCell c = ((DayRenderEventArgs)e).Cell;

        if (d.IsOtherMonth)
        {
            c.Controls.Clear();
        }
        else
        {
            try
            {
                   // Need to select the date -
            }
            catch (Exception exc)
            {
                Response.Write(exc.ToString());
            }
        }      
    }
0
Comment
Question by:CJSantora
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
e1v earned 500 total points
ID: 17802438
Are you trying to select several dates in the calendar? Then you can use the SelectedDates property of the calendar (at least in asp 2 you can) like:

foreach (DateTime d in yourDateList) Calendar1.SelectedDates.Add(d);
0
 

Author Comment

by:CJSantora
ID: 17818079
Sorry for the slow response, I just have to many projetcts going right now. Your answer was exactly what I needed and I appreciate your help.

CJSantora
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

738 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