Solved

Call the DayRender Event

Posted on 2011-03-12
4
2,012 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 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