Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Working with calendar selections

Posted on 2006-10-25
2
Medium Priority
?
182 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

661 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