How to Set the range of the dates

5 posts, 1 answers
  1. balv
    balv avatar
    13 posts
    Member since:
    Apr 2010

    Posted 24 Sep 2010 Link to this post

    Hi All
    I want to Set the range of the dates the user will be able to navigate to, and a constraint on the dates that can be selected similar to RadCalendar.
    For example is 01/01/1900 to 12/12/9999
    Regards
    balv
  2. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 27 Sep 2010 Link to this post

    Hello,

    You need to set SelectableDateEnd and SelectableDateStart to the desired start and end dates. You can set them either in XAML or Code.

    Let me know if you have further questions.

    Best wishes,
    Boyan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. balv
    balv avatar
    13 posts
    Member since:
    Apr 2010

    Posted 27 Sep 2010 Link to this post

    I use version Q2 2010 SP1 but I can not see these properties in RadDatePicker
  5. balv
    balv avatar
    13 posts
    Member since:
    Apr 2010

    Posted 27 Sep 2010 Link to this post

    I am sorry for error of omission. I found these properties and use it but  when I type 01/01/1000 and Click button to show selectedDate then has any error.
    How to I prevent user choose or type invalid date(not between a range date)
    thanks.

    <UserControl xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"  x:Class="SilverlightApplication1.MainPage"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
      
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="8*"/>            
            </Grid.RowDefinitions>
            <my:RadDatePicker x:Name="radDatep" 
                              SelectableDateStart="01/01/1975" 
                              SelectableDateEnd="01/01/3000" 
                              DisplayDateStart="01/01/1975" 
                              DisplayDateEnd="01/01/3000" 
                              Height="20" 
                              Width="100"/>
            <Button x:Name="btn" Content="Click" Grid.Row="1" Height="23" Width="75"></Button>
        </Grid>
    </UserControl>
  6. Answer
    Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 30 Sep 2010 Link to this post

    Hello,

    This is the way RadDateTimePicker work at the moment, the properties you have used restrict just the dates selected from the calendar. We decided to leave more space for customization and that is why we have not restricted the date parsing in such specific scenarios. However you can easily manipulate it with some code using the ParseDateTimeValue event. With it you can set the range for the parsing. You can take a look at this help article for more info. You can also create a custom message, for example "Date not in allowed range".

     Let me know if you have further questions.

    All the best,
    Boyan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner