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

Remove Times from time Picker

5 Answers 652 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 11 Mar 2016, 11:16 AM
I am using the date time picker to display apointment times what I was wanting to do was remove times that where booked with the radscheduler I no this would be custom code but is their any pointers on how to remove items from time time picker element of date time ?.

5 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 11 Mar 2016, 02:30 PM
Hello Phillip,

The RadTimePicker control supports using custom collection to define the available times. Check out the following article that describes the functionality in more detail:



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Philip
Top achievements
Rank 1
answered on 12 Mar 2016, 09:27 AM
I have submit a ticket would i get an example of how do bind to appointments to remove only add in times aviable within a given start time and end time
0
Viktor Tachev
Telerik team
answered on 14 Mar 2016, 01:15 PM
Hello Philip,

The following code snippets illustrate how you can set custom times for the RadTimePicker control:


<telerik:RadTimePicker runat="server" ID="RadTimePicker1"></telerik:RadTimePicker>
 
<asp:Button ID="Button1" Text="Set times in picker" runat="server" OnClick="Button1_Click" />


public DateTime[] GetTimes()
{
    // get info from database
 
    List<DateTime> times = new List<DateTime>();
 
    times.Add(new DateTime(2016, 1, 1, 12, 00, 00));
    times.Add(new DateTime(2016, 1, 1, 12, 20, 00));
    times.Add(new DateTime(2016, 1, 1, 13, 10, 00));
    times.Add(new DateTime(2016, 1, 1, 14, 30, 00));
 
    return times.ToArray();
}
 
protected void Button1_Click(object sender, EventArgs e)
{
    RadTimePicker1.TimeView.CustomTimeValues = GetTimes();
 
}

I am also attaching a sample page where the approach is implemented.

Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Philip
Top achievements
Rank 1
answered on 14 Mar 2016, 03:48 PM

Hi Mate thanks very much now they have asked me can the radseculer apppointments also be customised as well. Ie here i want the abilitie to remove times from the Sceduler as well its so an introducer can see what times are available during a day can the same process be used , I have tried the examples of adding people basicaly their are 5 managers and they need to see what slots each has avaiblable.

 

 

0
Viktor Tachev
Telerik team
answered on 15 Mar 2016, 09:34 AM
Hello Philip,

If you have a query for customizing the RadScheduler control please submit a separate ticket or thread for it.

This way the information in the threads will be kept consistent and will be easier to find for someone with similar scenario.

Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
DateTimePicker
Asked by
Philip
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Philip
Top achievements
Rank 1
Share this question
or