Browse Source

DateTimePicker: fixed issue with custom format and binding the same dateTime to multiple DateTime controls.

import/raw
brianlagunas_cp 16 years ago
parent
commit
37f3338bd9
  1. 5
      Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs

5
Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs

@ -55,7 +55,10 @@ namespace Microsoft.Windows.Controls
{
_dateTimeParser.Format = GetFormatString(newValue);
InitializeDateTimeInfoListAndParseValue();
Text = ConvertValueToText();
//I forgot why I set the text here. I believe it had to deal with databinding to the format. Either way we need to make sure there is a value before we try to set the text.
if (Value.HasValue)
Text = ConvertValueToText();
}
#endregion //Format

Loading…
Cancel
Save