private void calendar1_LoadItems_1(object sender, CalendarLoadEventArgs e) { if (_data.ScheduledItems.Count > 0) { PlaceItems(); } SetScrollValues(); }
// loads events to calendar-view. private void Calendar_LoadItems(object sender, CalendarLoadEventArgs e) { foreach (Event @event in this._events) // loop through events. { CalendarItem c = new CalendarItem(this.Calendar, @event.Time.LocalTime, @event.Time.LocalTime.AddHours(1), @event.FullTitle); // create a calendar item. if (Calendar.ViewIntersects(c)) // if the event intersects view calendars current view range (start day-end day). { c.Tag = @event; // store event on the tag. c.ToolTipText = @event.FullTitle; // item tooltip. Calendar.Items.Add(c); // add it to calendar. } // we don't need to add this event to calendar as the calendar view does not interesect event date & time. // (The calendar will explicitly re-ask us the events list when it's view range changes). else c = null; } }
protected virtual void OnLoadItems(CalendarLoadEventArgs e) { if (LoadItems != null) { LoadItems(this, e); } }
private void calendar1_LoadItems(object sender, System.Windows.Forms.Calendar.CalendarLoadEventArgs e) { PlaceItems(); }
private void calendar1_LoadItems(object sender, CalendarLoadEventArgs e) { PlaceItems(); }
private void calendar1_LoadItems(object sender, CalendarLoadEventArgs e) { var bk = vc.BookingsToCalendar(); List<ItemInfo> lst = new List<ItemInfo>(); foreach (Booking item in bk) { lst.Add(new ItemInfo(item.StartTime, item.EndTime, item.Firstname, item.Surname, item.Types)); } foreach (ItemInfo item in lst) { CalendarItem cal = new CalendarItem(calendar1, item.StartTime, item.EndTime, item.FirstName); _items.Add(cal); } PlaceItems(); }