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
2090
XamDatetimeeditor time only creates FormatException during entry
posted

Hello,

I am using a XamDateTimeEditor inside a XamDatagrid to enter time. During the entry - after pressing the first number - I get multiple System.FormatException

Is there a way to prevent this exception to happen?

Thanks

Niko

XAML looks like this. The EventHandler AutoCompleteMinute is called on editending and does not recieve invalide time (e.g. 1 of 12:00)

    <Style TargetType="{x:Type igEditors:XamDateTimeEditor}" x:Key="Uhrzeit">
                    <Setter Property="Mask" Value="{}{time}" />
                    <Setter Property="Format" Value="HH:mm" />
                    <Setter Property="PromptChar" Value="" />
                    <EventSetter Event="EditModeEnding" Handler="AutoCompleteMinute" />
                </Style>


                    <igDP:UnboundField Label="Startzeit" Name="Startzeit" BindingPath="Startzeit" BindingMode="TwoWay" Visibility="Collapsed">
                        <igDP:UnboundField.Settings>
                            <igDP:FieldSettings Width="50" EditorType="{x:Type igEditors:XamDateTimeEditor}" LabelClickAction="Nothing">
                                <igDP:FieldSettings.EditorStyle>
                                    <Style TargetType="{x:Type igEditors:XamDateTimeEditor}" BasedOn="{StaticResource Uhrzeit}"/>
                                </igDP:FieldSettings.EditorStyle>
                            </igDP:FieldSettings>
                        </igDP:UnboundField.Settings>
                    </igDP:UnboundField>

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Niko,

    I have been investigating into the behavior you are seeing, and I have put together a sample project based on the sample code you have provided, both with a bound Field and an UnboundField as I wanted to ensure that this wasn’t specifically an UnboundField issue. In doing so though, I am unable to reproduce the behavior you are seeing.

    I am attaching the sample project I used to test this. Please test this project on your PC, as whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 20.1.20201.26 in Infragistics for WPF 2020 Volume 1.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

    Please let me know if you have any other questions or concerns on this matter.

    XamDataGridDateTimeEditorTest.zip

Children