GridCalendar

Calendar component for displaying larger time intervals with months displayed one below another in a grid.

GridCalendar2

GridCalendar provides rich style hierarchy for setting the desired appearance. It allows to define style for each individual part, including Header, Footer, Row and Column Headers. Days have one common style and multiple style options for defining special appearance, such as selected days, holidays, days of week, days with special events etc.

Months styled

GridCalendar allows you to display individual months in different styles, using the MonthRanges and MonthRangeStyle definitions. Every MonthRange consists of StartYear/StartMonth and EndYear/EndMonth definition. When the Year definition is left blank, the range is applied for all years. MonthRangeStyle definition allows to set month background, Row Header style and a day shape.

GridCalendar_MonthRanges

Individual dates styled

It is possible to set even the apperance of individual days using the DateItems and DateItemStyle definitions. Each day can contain multiple events defined as DateItem structure. DateItem definition consists mainly of date and text displayed in a tooltip. DateItem can have its style - either it can use one of styles defined in DateItemStyles collection or it can have its own style defined. With Calendar.ShowDateItem property set to true the image or text abbreviation can be displayed directly in the day cell.

GridCalendar_Tooltip

The date can contain multiple DateItems. When the items are of different appearance, styles are combined when possible, so for example a red border and a blue background can be displayed at a time.

Data binding

DateItems collection can be filled using data binding. After specifying necessary DisplayMemberDate and DisplayMemberText members any DataTable or object collection can be bound to calendar. Dates are then populated with events from the data source. Data binding would not be complete without having the possibility to style the items - this can be done with setting the DisplayMemberImageIndex and the DisplayMemberStyle properties.

Date range

The range of displayable dates can be set through MinDate and MaxDate properties. The information about currently displayed range is always accessible in FirstVisibleDate and LastVisibleDate properties.
The initial setting of first displayed date can be done with ShowMode property. ShowMode.MinDate option shows the beginning of the date range, while ShowMode.MaxDate shows its end. ShowMode.Today sets actual month as a start month. Last option is ShowMode.DefaultDate which shows the month stored in DefaultDate property as a first visible month.

Navigation

Multiple navigation concepts are available. For vertical scrolling the ScrollBar or NavigationBar can be displayed on the right side of calendar. For navigation between months there can be dropdown button displayed that opens a new component called MonthSelector. You achieve this through the NavigationMode and ShowMonthSelector properties. The MonthSelector has its own branch in calendar style definition.

GridCalendar1

Selection

Multiple day selection modes are available through the SelectionMode property. SingleDay mode makes the last clicked date selected. Continuous mode enables to select the date range. Random mode allows user to select multiple dates and ranges using Ctrl and Shift keys, same as during standard Windows selection. The maximum selected day count can be defined with a MaxSelectionCount property. Selection can also be disabled at all.

GridCalendar_Selection

Events

GridCalendar contains rich event model which enables you to handle a number of user actions. All calendar parts, including individual days, provide information about user mouse actions and clicks. You can also get information about selection changes, calendar navigation and resizing. The appearance of any day can be updated during data binding using the ItemBinding event.

 

 

Watch the video and learn more about .NET WinForms Suite