To reference the template in the designer view, perform the following:
Reference the embedded template by pasting the following code into DatePickerDesignerView.cs:
Provide reference to the RadDatePicker controls that define the minimum and maximum dates by pasting the following code:
Override the InitializeControls method and leave its body empty:
Provide a property for the HTML tag for the control by pasting this code:
Save the file.
To specify a default template for the control, you must override the LayoutTemplateName property in the DatePickerDesignerView class. It must return a string that is a reference to the embedded resource that represents your template.
The template that you defined in Date picker widget: Create the template of the view of the designer, uses two RadDatePicker controls for setting the minimum and maximum dates. You must create instances of the controls to access the selected values. To reference the controls from theDatePickerDesignerView.ascx you must call GetControl and returning the controls’ values.
NOTE: When using templates make sure you address the controls after they have been initialized. The moment, where the template is initialized and ready to use, is the InitializeControls method. In it and after its execution, you can safely call your controls. You can call theEnsureChildControls() method before every reference to a template control.
Next, you must implement the features of the designer view.
Back To Top