Solved

Working with calendar selections

Posted on 2006-10-25
2
178 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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