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

Custom Times Remove a speicifc time slot

1 Answer 183 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 13 Mar 2016, 02:51 PM

Thanks for the last reply I am not a we bit futher on I am building a custom provider list for the date times but what I have not been able to figure out is how to match dates that have already been inputed in my table i am using appointments from radsechulre i am trying to check dates in the db though that are stored in datetime values but when I try to set the custom value that you suggest here is some of my code.

 

 

On My drop down of managers I am going out to the function as so. So What i need be able to do is set a pre definined block times and intervals and two remove any time thats been saved in the db already.

 

  

1.protected void rdManagers_SelectedIndexChanged(object sender, Telerik.Web.UI.DropDownListEventArgs e)
2.        {
3.            customDatePickerProvider _timePickerValues = new customDatePickerProvider(new Guid(e.Value), Convert.ToDateTime("09:00"), Convert.ToDateTime("18:00"));
4.            rdStarDate.TimeView.CustomTimeValues = _timePickerValues.BuildTimeList(true, new Guid(e.Value), Convert.ToDateTime("09:00"), Convert.ToDateTime("18:00"));
5.        }
6. 
7.01.
8.public D

01.public DateTime[] BuildTimeList(Boolean removeList, Guid managerID, DateTime startDate, DateTime endDate)
02.      {
03.          var q = _dal.checkDatesAvailabilty(managerID).ToList();
04.          if (q != null)
05.          {
06.              DateTime[] timesForPicker = new DateTime[] { new DateTime(2012, 12, 15, 12, 10, 10), new DateTime(2012, 12, 15, 5, 6, 3), new DateTime(2012, 12, 15, 3, 8, 11) };
07. 
08.              Array.ForEach(q.ToArray(), l =>
09. 
10.              {
11.                  //we want to try and parse the date out of the prenset list here we going to use the date range function to create a list of dates
12.              });
13.              return timesForPicker;
14.          }
15.          return null;
16.      }

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 14 Mar 2016, 01:17 PM
Hi Philip

i have replied to your query in the other thread you have submitted. Check out the answer by following the link below:



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
Share this question
or