This is a migrated thread and some comments may be shown as answers.

datepicker date format

5 Answers 184 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
j
Top achievements
Rank 1
j asked on 09 Feb 2010, 05:05 PM
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

5 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 11 Feb 2010, 01:48 PM
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.
0
j
Top achievements
Rank 1
answered on 11 Feb 2010, 04:33 PM

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
0
Konstantina
Telerik team
answered on 12 Feb 2010, 05:02 PM
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.
0
j
Top achievements
Rank 1
answered on 19 Feb 2010, 09:33 PM
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.


0
Konstantina
Telerik team
answered on 24 Feb 2010, 03:01 PM
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.
Tags
DatePicker
Asked by
j
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
j
Top achievements
Rank 1
Share this question
or