Solved

Working with calendar selections

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 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