This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have a DateTimePicker on a grid. The format is set to "LongTime". If the hour value initially contains a 2 digit value then everything is fine, you can enter in a one or 2 digit value as expected. If you change the hour value to a 1 digit value, tab to another field, then try to change it back to a 2 digit value it won't let you, the control is only acceptin one digit. Oddly it will accept a second digit if you type "02" but if you try to enter 12 it won't let you enter the 2, just the one. You can use the sample that I posted for the sorting problem last week to test this: http://www.mindscape.co.nz/forums/storage/13/6958/PropertyGridTester.zip Exact steps to repro Under "Current Time" key in a 1 digit value for the hour field. Press Tab to move to next field Select the hour field again Try to type in the number 12. You will notice that you can type the 1 but it won't let you key in a second digit. Any help is appreciated! Sean
|
|
|
FYI I have a workaround. I changed the format on the DateTimePicker from LongTime to Custom. I then bound the custom format to a property on the control that hosts my DateTimePicker as follows: CustomFormat ="{Binding Path=CustomTimeFormatString, ElementName=ctlPropertyEditor, Mode=Default}"The property on the control is then defined as such: Public ReadOnly Property CustomTimeFormatString() As String GetDim strRet = CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern.Replace("h" & CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator, "hh" & CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator).Replace(CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator & "m" & CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator, CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator & "mm" & CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator).Replace(CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator & "s" & CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator, CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator & "ss" & CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator) Return strRet End Get End PropertySean |
|
|
Thanks Sean. I'll be aiming to look at the underlying problem this week -- sorry for the delay but we have been pretty heads-down this last week! |
|
|
I am having this same problem any fix yet Ivan? |
|
|
Candidate fix will be in the 7 Jan nightly. (Sorry this slipped through the cracks, Sean.) |
|
|
No problem, my custom format fix has been working fine so it was no rush. I will try to take it for a spin at some point (heads down here as well). Thanks, Sean |
|