I just realized that when using a nullable (Nullable=true) WebDatePicker I cannot do this:
DateTime? a = null;
...
this.WebDatePicker1.Date = a;
Therefore, I am forced to do the following:
if (a.HasValue)
{
this.WebDatePicker1.Date = a.Value;
}
else
this.WebDatePicker1.Date = new DateTime();
Is there any way to take advantage of the nullable property of the control or am I stuck with the above?
Hi bpg730,
The Date property of WebDatePicker has type of DateTime. It was designed for application which need accessor of that particular type (without typecast).
The main property of WebTextEditor and all its extensions is Value which has type of object.
this.WebDatePicker1.Value = a;