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

x
?
Solved

Call the DayRender Event

Posted on 2011-03-12
4
Medium Priority
?
2,054 Views
Last Modified: 2012-05-11
I am using the Dayrender event to make certain days unselectable.

When the user selects a different calendar month, the disabled days become enabled.

I believe that I need to call the dayrender event from the SelectionChanged event.

protected void calToDate_SelectionChanged(object sender, EventArgs e)
        {
             //Call the dayrender event
             What is the code to do this?

---
This works, I just need to call it from the  calToDate_SelectionChanged procedure.
protected void calToDate_DayRender(object source, DayRenderEventArgs e)
    {
        int intToMonth = dteCalToDate.Month;
        int intToDay = (dteCalToDate.Day + 1);
        if (e.Day.Date.Day >= intToDay && e.Day.Date.Month == intToMonth)
        {
            e.Cell.Controls.Clear();
            e.Cell.Text = e.Day.DayNumberText;
            e.Cell.BackColor = System.Drawing.Color.Orange;
        }

Thanks,
0
Comment
Question by:Dovberman
[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
  • 3
4 Comments
 

Assisted Solution

by:Dovberman
Dovberman earned 0 total points
ID: 35118090
protected void calToDate_SelectionChanged(object sender, EventArgs e)
        {
             //Call the dayrender event
             What does the following code do?
             I does not call the calToDate_DayRender procedure .
             calToDate.DayRender += new DayRenderEventHandler(this.calToDate_DayRender);
             What am I missing?          


This works, I just need to call it from the  calToDate_SelectionChanged procedure.
protected void calToDate_DayRender(object source, DayRenderEventArgs e)





0
 

Accepted Solution

by:
Dovberman earned 0 total points
ID: 35123209
The dayrender event cannot be called directly.

This event is fired when the web page is loaded.

You can however call the page load event.

protected void calFromDate_VisibleMonthChanged(Object sender, MonthChangedEventArgs e)
    {
        // Causes the calendar to be rendered when the month is changed
        this.Load += this.Page_Load;
        refPrintGrid.Visible = true;
    }

0
 

Author Closing Comment

by:Dovberman
ID: 35163482
I found the solution myself.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

704 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