Hello friends
I want to create calendar in C#. do u have any information about that then plz let me know...
Thanks
Hello friends
I want to create calendar in C#. do u have any information about that then plz let me know...
Thanks
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.
Try this
Code:CalendarDay d = ((DayRenderEventArgs)e).Day; TableCell c = ((DayRenderEventArgs)e).Cell; if ( !d.IsOtherMonth ) c.Controls.Add(new LiteralControl(dr["EventDetails"].ToString()));
Hey i told before also don't post any code first he should try. Then we are here to help him.
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.
Bookmarks