DatePicker Event

Dear Expert.
I’m working with DatePicker in factory studio via code behind.
In my request, I need to create a event for DatePicker when I click to choose a datetime for it in runtime.
What Type Of event of DatePicker ?
Best.

Hello Thanos,

The DatePicker component does not have an event for SelectedDateChanged.

In this case, you can use the example script below, which displays a message when the value of the DatePicker is changed.

TDatePicker dp;
string prevDate;

public void DisplayOpening()
{
    dp = this.CurrentDisplay.GetControl("datepicker") as TDatePicker;
    prevDate = dp.SelectedDate.ToString();
}

public void DisplayIsOpen()
{
    if (!prevDate.Equals(dp.SelectedDate.ToString()))
    {
        MessageBox.Show("Your event code here!");
        prevDate = dp.SelectedDate.ToString();
    }
}

Where “datepicker” in GetControl command must be replaced by the uid of your DatePicker.

Hope it helps.

Bests,
Tatsoft Team.

Thank your support.
I tried and it worked.
Best