|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
Introduction
I was asked to do this at a charity to help projects co-ordinate and know what everyone else is doing. The website allowed people to enter details of an event on a web form which then got displayed grouped by 'business initiative'. The events were stored in an MS SQL server. It was very easy to pull out the data from the DB and format it into hierarchical XML required by the Calendar Control using a Using the CodeTo use the You can then set the Next in the code behind page, EventCalendarControl1.XMLData = xmlData;
EventCalendarControl1.BlankGifPath = "trans.gif";
EventCalendarControl1.Year = 2005;
EventCalendarControl1.Quarter = 2;
EventCalendarControl1.BlockColor = "blue";
EventCalendarControl1.ToggleColor = "#dcdcdc";
EventCalendarControl1.CellHeight = 15;
EventCalendarControl1.CellWidth = 15;
Now for the XML: The XML format is very simple, simply groups which contain blocks (events). Each group shows up 'grouping' a list of events. Note that, it doesn't matter what contains the group nodes or the top level nodes, as I'm doing a global search on 'group' using the // XPath.
Example XML: xmlData = "<NewDataSet>"
xmlData += " <group>";
xmlData += " <name>Develop Specifications</name>";
xmlData += " <blockcolor>#cc66cc</blockcolor>";
xmlData += " <block>";
xmlData += " <href>activity.aspx?ActID=17</href>";
xmlData += " <StartDate>2005-04-10T00:00:00.0000000+01:00</StartDate>";
xmlData += " <EndDate>2005-05-10T00:00:00.0000000+01:00</EndDate>";
xmlData += " <name>Technical Architecture</name>";
xmlData += " </block>";
xmlData += " <block>";
xmlData += " <href>activity.aspx?ActID=18</href>";
xmlData += " <StartDate>2005-04-15T00:00:00.0000000+01:00</StartDate>";
xmlData += " <EndDate>2005-05-15T00:00:00.0000000+01:00</EndDate>";
xmlData += " <name>Software Architecture</name>";
xmlData += " </block>";
xmlData += " </group>";
xmlData += "</NewDataSet>"
Assuming the data is contained in a database, the best way to generate this XML is by using a About the codeThe control is a non-composite control which means it's not based on or derived from standard web controls. Sometimes, when you require greater control over what HTML is produced, you may consider creating this type of control to encapsulate it. It's quite easy to do, all you need to do is to create a 'Web Control Library' and then override the I had to use some JavaScript too for the control. The JavaScript allows the control to be resized, so that the scrollbar on the right hand pane of the event calendar resizes. The JavaScript is registered in the Further workUsing this code, it should be easy to enhance it, so to add, say, duration into the left hand pane or highlight the critical path.
|
||||||||||||||||||||||||||||||