Views Walkthrough
In this walkthrough (part of the Telerik UI for WinForms Step-by-step Tutorial) you will dynamically change the view, change some of the view specific properties and handle the ActiveViewChanging event.
Project Setup
Create a new Windows Forms application.
In the Solution Explorer, delete the default form.
Also in the Solution Explorer, right-click the project and select Add | New Item... from the context menu.
Select the "Telerik RadForm" template and click the Add button to close the dialog.
Add the DesertTheme from the ToolBox to the form.
In the Properties window, set the form ThemeName to Desert.
Add a RadStatusStrip to the form. Set the ThemeName to Desert. Add a RadLabelElement to the status strip. Set the Name property to "lblStatus" and the Text to "".
-
Add a RadCommandBar to the form. Add elements to the bar:
- Add a RadCommandBarDropDownList. Set the Name to "ddlActiveViewType" and Text to "".
- Add a RadCommandBarDropDownList. Set the Name to "ddlRange" and Text to "".
- Add a RadCommandBarDropDownList. Set the Name to "ddlACount" and Text to "".
Change the new RadForm1 to be the startup form.
From the Toolbox, add a RadScheduler to the form and set the Dock property to "Fill" and the ThemeName to Desert.
Add code to the form load that will add values to the combo boxes in the tool strip for SchedulerViewType and ScaleRange enumerations. Also, add a simple range of integers to the "count" combo box.
12. Next add a SelectedIndexChanged event handler for the ddlActiveViewType combo box:
13. Add another SelectedIndexChanged event handler for the ddlRange combo box element:
14. Add another SelectedIndexChanged event handler for the ddlCount combo box element:
15. Handle the RadScheduler ActiveViewChanging event. Use the SchedulerViewChangingEventArgs OldView and NewView to display in the status label.
16. Run the application and test the various combinations of settings.
Figure 1: Views Walkthrough