Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1871
Date time value.
posted

Is there any difference between setting the date/time on the ultraDateTimeEditor control?

I usually set the new date/time this way:

DateTime calculatedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day);

Infragistics.Win.UltraWinEditors.UltraDateTimeEditor actualDate;

 

actualDate.DateTime = new DateTime(calculatedDate.Year, calculatedDate.Month, calculatedDate.Day);

I have also seen it set this way:

actualDate.ultraDateTimeEditor1.Value = calculatedDate

Is either way better or do they both accomplish the same goal?

 

  • 469350
    Verified Answer
    Offline posted

    Hi Michael,

    The difference is that Value is an object. So you could set it to Null.

    The DateTime property is a DateTime which is a struct and therefore can never be null.