datepicker date format

6 posts, 0 answers
  1. j
    j avatar
    8 posts
    Member since:
    May 2009

    Posted 09 Feb 2010 Link to this post

    Hi,

    I use datepicker which binding to db type date. it shows mm/dd/yyyy hh:mm:ss, can i format to mm/dd/yyyy

    Thanks
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 11 Feb 2010 Link to this post

    Hi j,

    Thank you for contacting us.

    Unfortunately, this is not a supported feature. You can format the date in the SelectionChanged event of the DatePicker, for example like:
    private void radDatePicker_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
           {
               DateTime? date = new DateTime();
               date = radDatePicker.SelectedDate;
               date.Value.ToShortDateString();
           }

    Hope this helps.

    If you have further questions please feel free to contact us again.

    Kind regards,
    Konstantina
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. DevCraft banner
  4. j
    j avatar
    8 posts
    Member since:
    May 2009

    Posted 11 Feb 2010 Link to this post

    I use

    <DataTemplate x:Key="datetime1">  
       <telerikInput:RadDatePicker SelectionChanged="RadDatePicker_SelectionChanged" SelectedDate="{Binding Path=RegistrationDeadline,Mode=TwoWay}" > 
      </telerikInput:RadDatePicker> 
    </DataTemplate> 

    in usercontrol.resources

    and assign to the column edittemplate
    grid1.Columns["RegistrationDeadline"].CellEditTemplate = (DataTemplate)Resources["datetime1"]; 

    for you example code, i can not use radDatePicker.SelectedDate
    do you know how can i access to it. how about use SelectionChangedEventArgs?
    thanks
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 12 Feb 2010 Link to this post

    Hello j,

    Thank you for the code snippets.

    I suggest you make the formatting of the date in the property RegistrationDeadline to which you have bound SelectedDate property of the DatePicker.

    Hope this helps.

    If you still experience difficulties please feel free to contact us again.

    Best wishes,
    Konstantina
    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.
  6. j
    j avatar
    8 posts
    Member since:
    May 2009

    Posted 19 Feb 2010 Link to this post

    do you how?

    thanks

    Hello j,

    Thank you for the code snippets.

    I suggest you make the formatting of the date in the property RegistrationDeadline to which you have bound SelectedDate property of the DatePicker.

    Hope this helps.


  7. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 24 Feb 2010 Link to this post

    Hi j,

    Thank you for your question.

    Attached you will find a sample project in which is illustrated the use of the SelectedDate property.
    Hope this helps.

    If you have further questions please feel free to contact us again.

    Greetings,
    Konstantina
    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