Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old January 4th, 2007, 01:54 AM
Registered User
Join Date: Jan 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create event in Calendar

Dear all,

I am crating personal event calendar with asp.net 2.0.

I am facing with problem with showing event that take more than one day in asp.net calendar.

when I show in asp.net 2.0 calendar I can only show one day event only.

How to show like this one (google calendar)


I want to show event over days

please kindly give me advice.

Here is my code:

 protected void EventCalendarDayRender(object sender, DayRenderEventArgs e)
            CalendarDay d = ((DayRenderEventArgs)e).Day;
            TableCell c = ((DayRenderEventArgs)e).Cell;

            // If there is nothing to bind
            if (this.EventSource == null)

            DataTable dt = this.EventSource;

            foreach (DataRow dr in dt.Rows)
                if (EventDateColumnName == string.Empty)
                    throw new ApplicationException("Must set EventCalendar's EventDateColumnName property when EventSource is specified");
                if (EventHeaderColumnName== string.Empty)
                    throw new ApplicationException("Must set EventCalendar's EventHeaderColumnName property when EventSource is specified");

                if (EventDateColumnName != string.Empty
                    && !d.IsOtherMonth
                    && Convert.ToDateTime(dr[this.EventDateColumnName]).ToShortDateString() == d.Date.ToShortDateString())
                        //Changes made for align the events
                    c.ColumnSpan = 2;
                    c.Controls.Add(new LiteralControl("<fieldset>")); //class=" + EventStyleName + "

                        System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label();
                        lbl.Text = dr[EventHeaderColumnName].ToString();
                        //lbl.CssClass = EventStyleName;
                        lbl.Width = Unit.Percentage(98);
                        lbl.Attributes["OnClick"] = "showPopWin('EventEdit.aspx?ID=" + dr[EventIDColumnName].ToString() + "', 580, 400, null);";

                    if (this.ShowDescriptionAsToolTip)
                        if (this.EventDescriptionColumnName != string.Empty)
                            //Multiline ToolTips
                            lbl.ToolTip = string.Format(dr[EventDescriptionColumnName].ToString(),Environment.NewLine );
                    c.Controls.Add(new LiteralControl("</fieldset>"));

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
create calendar from spreadsheet data iacon Excel VBA 1 February 10th, 2011 12:53 PM
need help to create my country calendar dimension dbayona SQL Server 2000 1 July 4th, 2007 12:54 AM
Lesson on Event Calendar - Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 6 April 6th, 2004 03:03 PM

All times are GMT -4. The time now is 06:16 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.