I went over the control's original article, but can't figure out how to add events to the calendar. The methods mentioned in the original article aren't showing up in intellisense and I don't see anything in intellisense that looks like it would add items - something like Calendar1.items.add() or whatever.
I'm reading the events from an XML file. I'm iterating through the events in the XML data and want to add them to the Calendar as I loop through each of the event nodes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
// Add the items to the calendar
calendar1.Items.Clear();
foreach (CalendarItem item in items)
{
if (calendar1.viewIntersects(item))
{
calendar1.Items.Add(item);
}
}
Chris Bray
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I went over the control's original article, but can't figure out how to add events to the calendar. The methods mentioned in the original article aren't showing up in intellisense and I don't see anything in intellisense that looks like it would add items - something like Calendar1.items.add() or whatever.
I'm reading the events from an XML file. I'm iterating through the events in the XML data and want to add them to the Calendar as I loop through each of the event nodes.
Something like this?:
// Create some calendar items
var items = new List<>CalendarItem();
items.Add(new CalendarItem(calendar1, DateTime.Now, DateTime.Now.AddMinutes(30), "First Appointment");
items.Add(new CalendarItem(calendar1, DateTime.Now.AddDays(1), DateTime.Now.AddDays(1).AddMinutes(30), "First Appointment");
// Add the items to the calendar
calendar1.Items.Clear();
foreach (CalendarItem item in items)
{
if (calendar1.viewIntersects(item))
{
calendar1.Items.Add(item);
}
}
I just double click on the time I want to add something, and then start typing. It adds an item for me.
Anything I do, I keep getting NULL REFERENCE....here is my code