Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 4th, 2007, 02:54 AM
Registered User
Join Date: Jan 2007
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>"));

Similar Threads
Thread Thread Starter Forum Replies Last Post
create calendar from spreadsheet data iacon Excel VBA 1 February 10th, 2011 01: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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.