Define a Custom ViewDefinition
This topic will demonstrate the customization capabilities provided by RadScheduler for defining a custom ViewDefinition. Determining which ViewDefinition to inherit, so that the needed customizations are based on it, depends on the particular needs. More information on the built-in ViewDefinitions can be found in the Overview topic.
As modifying the appearance of different elements of the control is discussed in this article, it is recommended to review the Visual Structure topic first.
Custom DateGroupDescription
When a custom ViewDefinition based on WeekViewDefinition or MonthViewDefinition is defined, you could customize the grouping of the used DateGroupDescription. In this case the DateGroupDescription property of the ViewDefinition needs to be overriden by returning a custom object inheriting from DateGroupDescription. The custom DateGroupDescription object needs to override the GroupLength property.
Example 1: Defining the custom DateGroupDescription and custom WeekViewDefinition
Example 2: Adding the custom definition
Figure 1: Custom DateGroupDescription
Set the Format of the Group Header
The format of the Group Header can be altered by overriding the FormatGroupHeaderName method.
Example 3: Set the format of the Group Header
Figure 2: Formatted GroupHeader name
Format the Text of the Visible Range
The format of the string that represents the currently visible range can be modified by overriding the FormatVisibleRangeText method.
Example 4: Set the format of the currently visible range text
Figure 3: Modified format of the visible range text
Show the Week Group Headers
By default, the week group headers are hidden. They can be shown by overriding the GetShowWeekGroupHeaders method
Example 5: Show the week group headers
Figure 4: Showing the week group headers
Set the Beginning and the End of the Visible Range
The DateTime values for the start and end of the visible range, can be set through the GetVisibleRangeStart and GetVisibleRangeEnd methods.