New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
ChildrenCreated
RadDatePicker exposes the ChildrenCreated server event, which occurs after the child controls have been created.
The ChildrenCreated event handler receives two arguments:
-
The control whose children have just been created. This argument is of type object, but can be cast to the appropriate type.
-
A DefaultViewChangedEventArgs object. This object has the following two properties:
-
OldView is the CalendarView object for the view that was current before the change.
-
NewView is the CalendarView object for the current view after the change.
-
You can use this event to set date input and calendar properties, or add additional controls. The following example uses the ChildrenCreated event handler to add a control that clears the selection:
C#
protected void RadDatepicker1_ChildrenCreated(object sender, System.EventArgs e)
{
RadDatePicker picker = (RadDatePicker)sender;
HyperLink clearLink = new HyperLink();
clearLink.NavigateUrl = string.Format("javascript:$find('{0}').Clear()", picker.ClientID);
clearLink.Text = "Clear";
picker.Controls.Add(clearLink);
}