Hey Techie! Welcome to DiscussWeb the BEST displace for Technology Enthusiasts. You are currently viewing our community as a guest which gives you limited access to believe most technology discussions and our other features. By joining our IT community you will have access to post your technical questions help other community members by answering their questions getting yourself involved in technology topics of high quality communicate privately with other techies (PM) respond to polls transfer content and access many other special features. If you are in to web create by mental act and development software programming software testing internet marketing or anything related to technology this is the RIGHT place for you. As of today more than 500 techies have been involved in more than 8000 quality discussions on technology. So what are you waiting for? Registration is fast simple and absolutely FREE so gratify. !If you have any problems with the registration/login affect or if you undergo any suggestions for improving our community gratify conclude remove to.
Introduction Tracking anything in dates is one of the common requirement now a days. Tracking events project milestones tracking history tracking plan etc etc. It was quite a complex job until the wonderful Calendar hold back of ASP. NET 2.0. It is one of the Standard Server Side Web hold back of ASP. NET 2.0 which when used properly can back up in accomplishing the varoius requirements tracking being one of them. Here we are going to see how can this Calendar control can back up us in tracking the events
One of beat ways in which events can be displayed is by displaying the events by month. What it basically means is - display the end month and display the events against each go out. Here is how our Event Calendar is going to look desire :[IMG]register:///C:/DOCUME%7E1/SUNDER/LOCALS%7E1/TEMP/moz-screenshot jpg[/IMG]
It is quite simple and straight forward. ASP. NET Calendar hold back posses an event "DayRender" which has got "DayRenderEventArgs" as one of the parameters. This DayRenderEventArgs has got two very useful things - Day and Cell. Day is of the write "CalendarDay" and Cell is f the write "TableCell". Day can back up us in identifying the day date etc which it is going to get and Cell gives us command to the delay cell corresponding to that day. Now since we undergo command to delay Cell of displaying go out we can play with it to give to our needs. For event schedule we are simply going to use this event to add the event details in the delay Cells associated with the dates. CalendarDay d = ((DayRenderEventArgs)e). Day; TableCell c = ((DayRenderEventArgs)e). Cell; if ( !d. IsOtherMonth ) c. Controls. Add(new LiteralControl(dr["EventDetails"]. ToString())); And thats it we are done.
If we are aware that we are going to use the same functionality again and again it is exceed to alter it a re-usable component. So here we are going to increase the capabilities of basic ASP. NET 2.0 Calendar hold back. The basic requirement of data driven applications is that obtain of information basically is data store. It can be database. XML register. 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 obtain of data. Let us see the ingredients of this schedule hold back 1. A class which extends System. Web. UI. WebControls. schedule 2. The necessary properties :EventSource : DataTable with Event Details,EventStartDateColumnName : ColumnName of the Column of the type DateTime in the EventSource which stores the go away go out associated with EventsEventEndDateColumnName : ColumnName of the Column of the write DateTime in the EventSource which stores the End Date associated with EventsEventHeaderColumnName : ColumnName of the Column of the write 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 cause whether to display Event Description as drive Tip or not. EventForeColor: ColumnName of the Column to specify the Fore ( Font ) Color for the event. We can contract any alter Name which belongs to System. Drawing. Color namespace. EventBackColor: ColumnName of the Column to specify the Back alter for the event. We can contract any Color Name which belongs to System. Drawing. alter namespace. 3. EventCalendarDayRender Event : displace where the actual logic to show the events in schedule is implemented This describes the skeleton for your EventCalendar categorise. Refer to the EventCalendar cs class in the attached demo for complete implementation. By extending the control in such way we can act the basic features provided along with the new features/capabilities that we need to cater to our requirements.
ASP. NET Controls are undergoing development and continuous evolution with each channel. ASP. NET 2.0 Controls are no exception. These controls not only getting smarter and smarter but also giving a developer better command to its basic buidling blocks like TableCell of Calendar hold back. Please spare some time to rate and provide feedback about this article. Your bring together of minutes can back up in enhancing the quality of this article.
Gud job ! Sundaram. hi. gratify how can I add different colors to calendar events per row while I retreiving each row from database so that I can diffrenciate between events;desire this way. I am getting this error when I am trying to add a row to the schedule by giving it a specific alter."CS0200: Property or indexer 'System. Data. DataRowCollection this[int]' cannot be assigned to -- it is read only"the error is at this line: schedule1. EventSource. Rows[j]=dr;Please a back up!!!! ///////////////////////////////////////////////////////////////////////////////////////int j=0;// Yesterday's Eventsj++;dr = dt. NewRow();dr["Id"] = idCount++;dr["EventStartDate"] = DateTime. Now. AddDays(-1);dr["EventEndDate"] = DateTime. Now. AddDays(-1);dr["EventHeader"] = "My Yesterday's Single Day Event";dr["EventDescription"] = "My Yesterday's hit Day Event Details";dt. Rows. Add(dr);Calendar1. BackColor=Red;schedule1. EventSource. Rows[j]=dr;// Three Day's Event Starting Tomorrowdr = dt. NewRow();dr["Id"] = idCount++;dr["EventStartDate"] = DateTime. Now. AddDays(1);dr["EventEndDate"] = DateTime. Now. AddDays(+3);dr["EventHeader"] = "My Three Days Event";dr["EventDescription"] = "My Three Days Event Details which starts tomorrow";dt. Rows. Add(dr);Calendar1. BackColor=Red;schedule1. EventSource. Rows[j]=dr;////////////////////////////////////////////////////////////////////////////////////// Regards M. Ramesh
Thanks Sundaram. I gave the heading field a backgound & forecolor at the dilate I be as random turn also it works this way without adding the EventBackColor or EventForeColor into calendar component. Regards. M. Ramesh
Hi I was able to set event style by replacing the "<br />" tag in the EventCalendarDayRender event handler with a div tag desire this "<div categorise=\"" + EventDivStyle + "\">" where EventDivStyle is a new property I added to the EventCalendar class. Then you can set the EventDivStyle property of the hold back to a div css call.
Yes.
Forex Groups - Tips on Trading
Related article:
http://www.discussweb.com/asp-asp-net-programming/3690-event-calendar-asp-net-2-0-c.html
comments | Add comment | Report as Spam
|