The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I''m having a problem with the dattimepickeradv control. I have the datetimepicker bound to a text box to see the results of the datetimepicker. I get peculair results when I click on the ''none'' button, the bound value shown in the text box shows todays date instead of null. why would this be?
ADAdministrator Syncfusion Team April 29, 2005 04:47 PM UTC
Hi Eric,
Since DataTime is a value type, it can''t be given a null value. Therefore, DateTimePickerAdv represents a null date with the IsNullDate property. So to have a TextBox display Null if the date is null, you need to do something like this:
private void dateTimePickerAdv1_ValueChanged(object sender, System.EventArgs e)
{
if (this.dateTimePickerAdv1.IsNullDate)
{
this.textBox1.Text = "Null";
}
else
{
this.textBox1.Text = this.dateTimePickerAdv1.Value.ToLongDateString();
}
}
Regards,
Gregory Austin
Syncfusion Inc.
P.S. DateTimePickerAdv is a part of the Editor package of Tools, not Edit.