Solved

Call the DayRender Event

Posted on 2011-03-12
4
1,971 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
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 35115585
0
 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

738 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