private void customDateNavigator2_ContextButtonCustomize(object sender, CalendarContextButtonCustomizeEventArgs e) { if (e.Cell.Date.Day % 2 != 0) { e.Item.Glyph = Properties.Resources.Party; e.Item.Visibility = ContextItemVisibility.Visible; e.Item.ToolTip = "blah-blah-blah"; e.Item.ShowToolTips = true; } }
private void CalendarControl1_ContextButtonCustomize(object sender, CalendarContextButtonCustomizeEventArgs e) { string holidayText; if (Holidays.IsHoliday(e.Cell.Date, out holidayText)) { e.Item.Glyph = global::Calendar_CellStyleProvider.Properties.Resources.Party; e.Item.Visibility = ContextItemVisibility.Visible; e.Item.ToolTip = holidayText; e.Item.ShowToolTips = true; } }
void Calendar_ContextButtonCustomize(object sender, CalendarContextButtonCustomizeEventArgs e) { PopupCalendarControl popupCalendarControl = (PopupCalendarControl)sender; MyCellStyleProvider provider = (MyCellStyleProvider)popupCalendarControl.CellStyleProvider; MyCustomCellData data = ((MyCellStyleProvider)popupCalendarControl.CellStyleProvider).GetCell(e.Cell.Date); if (data == null || string.IsNullOrEmpty(data.InfoText)) { e.Item.Visibility = ContextItemVisibility.Hidden; return; } e.Item.Tag = data; e.Item.Glyph = data.InfoGlyph; }