Solved

Call the DayRender Event

Posted on 2011-03-12
4
1,852 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
  • 3
4 Comments
 
LVL 13

Expert Comment

by:agarwalrahul
Comment Utility
0
 

Assisted Solution

by:Dovberman
Dovberman earned 0 total points
Comment Utility
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
Comment Utility
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
Comment Utility
I found the solution myself.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now