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

SelectorFormat

2 Answers 62 Views
DatePicker and DateSelector
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Doug
Top achievements
Rank 1
Doug asked on 22 Jun 2011, 07:39 PM
Can you provide the string format used in the SelectorFormat property?

I'd like to, for example, show hours, minutes, seconds, and not display the AM/PM selector. Is this possible.

2 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 23 Jun 2011, 07:14 AM
Hello Doug,

Thanks for contacting us and for your question.

Currently, the RadTimeSelecto/RadTimePicker controls do not support seconds.

You can find a very useful information regarding the SelectorFormat property here:

http://www.telerik.com/help/windows-phone/radtimepicker-features-formatting.html

I hope this helps.

Do not hesitate to get back to us in case you have further questions or need assistance.

All the best,
Deyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Vijay
Top achievements
Rank 1
answered on 03 Jun 2012, 04:48 PM
Hello Doug,

Please find the below sample code for which describe how to setup selectorformat property value programmatically. In the below code, wcf service is used and communicated to progress request/response mechanism. Use this as sample model towards your requirements and this works out now.

SelectorFormat = "H/M/T". This can be customized as per the requirements as "h or H", "M or m" or "T or t".

Please find the below source code for much better idea towards this.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Telerik.Windows.Controls;
using Rad_Time_Selector_Application.ServiceReference1;
 
namespace Rad_Time_Selector_Application
{
 public partial class MainPage : PhoneApplicationPage
 {
 // Constructor
 public MainPage()
 {
 InitializeComponent();
 }
 
public void mainpage_Loaded(object sender, RoutedEventArgs e)
 {
 getRadTime();
 }
 
public void getRadTime()
 {
 objRadSelector.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
 objRadSelector.VerticalAlignment = System.Windows.VerticalAlignment.Center;
 objRadSelector.SelectorFormat = "H/M/T";
 objRadSelector.SelectedValueChanged +=new DateTimeValueChangedEventHandler(sel_Call);
 this.ContentPanel.Children.Add(objRadSelector);
 }
 
private void time_Call(object sender, timeCompletedEventArgs e)
 {
 RadMessageBox.Show("Selected Time is: " + e.Result.ToShortTimeString(), MessageBoxButtons.OKCancel, "RadTimeSelection - WCF", null, false, false, System.Windows.HorizontalAlignment.Stretch, System.Windows.VerticalAlignment.Center, null);
 }
 
protected void sel_Call(object sender, ValueChangedEventArgs<DateTime> e)
 {
 var time = objRadSelector.SelectedValue;
 objClient.timeCompleted +=new EventHandler<timeCompletedEventArgs>(time_Call);
 objClient.timeAsync(time);
 }
 
#region Instance Variables
 
RadTimeSelector objRadSelector = new RadTimeSelector();
 Service1Client objClient = new Service1Client();
 
 #endregion
 }
}


I hope this was useful!

Thanks and Regards,
Vijay
Tags
DatePicker and DateSelector
Asked by
Doug
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Vijay
Top achievements
Rank 1
Share this question
or