Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: DateTimePicker Validation

$
0
0
Hi,

I have a scenario I can't figure out how to implement.

I want to validate that from date is less than the to date. I am using the DateTimePicker control.
<StackPanel Orientation="Horizontal" Margin="5,2,5,2">
                                    <TextBlock Text="From Date: "  />
                                    <xctk:DateTimePicker x:Name="FromDatePicker"    
                                         AutoCloseCalendar="True"
                                         Width="200"
                                         VerticalAlignment="Center"
                                         HorizontalAlignment="Left"
                                        Value="{Binding FromDate, Mode=TwoWay}"
                                         Format="Custom"
                                         FormatString="dd-MMM-yy HH:mm"
                                         TimeFormat="Custom"
                                         TimeFormatString="HH:mm" 
                                         ToolTip="From Date">
                                    </xctk:DateTimePicker>

                                    <TextBlock Text="To Date: " />

                                    <xctk:DateTimePicker x:Name="ToDatePicker" 
                                         AutoCloseCalendar="True"
                                         Width="200"
                                         VerticalAlignment="Center"
                                         HorizontalAlignment="Left"
                                         Value="{Binding ToDate, Mode=TwoWay}"
                                         Format="Custom"
                                         FormatString="dd-MMM-yy HH:mm"
                                         TimeFormat="Custom"
                                         TimeFormatString="HH:mm" TimeWatermark="Please select time"
                                         ToolTip="To Date"/>
                                </StackPanel>
Can someone give me a hint on how to validate that the to date is greater than the from date?

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>