)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to retrieve selected date in DateTimePickerAdv?

Platform: WinForms |
Control: DateTimePickerAdv |
Published Date: February 19, 2016 |
Last Revised Date: May 22, 2019

In DateTimePickerAdv, the selected value can be retrieved by following below steps.

 

  1. The date selection of the calendar popup can be detected by handling the event named “DateSelected” of the Calendar property in DateTimePickerAdv.
  2. The selected value can be retrieved by using the property named “Value” in DateTimePickerAdv.

 

The following code example demonstrates the same.

C#

//Occurs on user makes the date selection.
this.dateTimePickerAdv1.Calendar.DateSelected += Calendar_DateSelected;
 
void Calendar_DateSelected(object sender, EventArgs e)
{
    label1.Text = this.dateTimePickerAdv1.Value.ToString();
}

 

VB

'Occurs on user makes the date selection.
AddHandler Me.dateTimePickerAdv1.Calendar.DateSelected, AddressOf Calendar_DateSelected
 
Private Sub Calendar_DateSelected(ByVal sender As Object, ByVal e As EventArgs)
    label1.Text = Me.dateTimePickerAdv1.Value.ToString()
End Sub

 

Note:

The DateSelected event will be raised when selecting the date using the mouse click.

 

Showing selected value

Figure 1: The selected value of the DateTimePickerAdv.

Sample Links:

C#: DateTimePickerAdv_SelectedValue_C#

VB: DateTimePickerAdv_SelectedValue_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon