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>