Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-06-2008
Member
 
Join Date: May 2008
Posts: 89
How to create Calendar in C#

Hello friends

I want to create calendar in C#. do u have any information about that then plz let me know...

Thanks
Reply With Quote
  #2  
Old 07-06-2008
Member
 
Join Date: Dec 2007
Posts: 71
Hey friends it's yours homework ... if you have any difficulty than we will solve. but first you try. We will not do your homework.
Reply With Quote
  #3  
Old 07-06-2008
Member
 
Join Date: May 2008
Posts: 89
Try this

Code:
CalendarDay d = ((DayRenderEventArgs)e).Day; 
        TableCell c = ((DayRenderEventArgs)e).Cell;    
    
        if ( !d.IsOtherMonth )    
            c.Controls.Add(new LiteralControl(dr["EventDetails"].ToString()));
Reply With Quote
  #4  
Old 07-06-2008
Member
 
Join Date: Dec 2007
Posts: 71
Hey i told before also don't post any code first he should try. Then we are here to help him.
Reply With Quote
  #5  
Old 07-06-2008
Member
 
Join Date: May 2008
Posts: 89
If have know about that we are going to use the same functionality again and again, it is better to make it a re-usable component. So here, you are going to extend the capabilities of basic C# Calendar control. The basic requirement of data driven applications is that source of information basically is data store. It can be database, XML File, Excel or anything for that matter. Here we are going to limit our scope and going to implement the EventCalendar with ADO.NET DataTable as the source of data. Let us see the ingredients of this calendar control

1. A class which extends System.Web.UI.WebControls.Calendar

2. The necessary properties :
EventSource : DataTable with Event Details,
EventStartDateColumnName : ColumnName of the Column of the type DateTime in the EventSource, which stores the Start Date associated with Events
EventEndDateColumnName : ColumnName of the Column of the type DateTime in the EventSource, which stores the End Date associated with Events
EventHeaderColumnName : ColumnName of the Column of the type String in the EventSource, which stores the Event Header,
EventDescriptionColumnName: ColumnName of the Column of the type String in the EventSource, which stores the Event Detailed Description,
ShowDescriptionAsToolTip : Boolean to determine whether to display Event Description as Tool Tip or not.
EventForeColor: ColumnName of the Column to specify the Fore ( Font ) Color for the event. We can specify any Color Name which belongs to System.Drawing.Color namespace.
EventBackColor: ColumnName of the Column to specify the Back Color for the event.We can specify any Color Name which belongs to System.Drawing.Color namespace.

3. EventCalendarDayRender Event : Place where the actual logic to show the events in Calendar is implemented

This describes the skeleton for your EventCalendar Class. Refer to the EventCalendar.cs class in the attached demo for complete implementation. By extending the control in such way we can keep the basic features provided along with the new features/capabilities that we need to cater to our requirements.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to create Calendar in C#"
Thread Thread Starter Forum Replies Last Post
How to Create Calendar in Excel Sanju Baba Windows Software 3 07-01-2012 01:03 PM
Cannot Create Multiple Calendar on iCloud? Jalela Technology & Internet 7 18-06-2011 09:24 PM
How to Create an Advent Calendar with JavaScript? MELTRONICS Software Development 5 05-02-2010 03:05 AM
Create a calendar always visible on my PC? migons Windows Software 5 04-02-2010 10:46 PM
How to create calendar add on visual studio Saaarc Software Development 3 30-07-2009 03:10 PM


All times are GMT +5.5. The time now is 06:02 PM.