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

RadDateTimePicker

5 Answers 299 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 01 Oct 2007, 03:19 PM
This control seem's to be deactivated on my form. Even when i set the focus on, nothing seem's to change, it remains grey. Is this the normal style? If yes how can i set the style so it is like a normal control ie : when focused the selected text is blue and so on...

5 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 02 Oct 2007, 12:57 PM
Hi Louis,

Thank you for your question.

Before getting to your question, I wanted to say that we are quite surprised by the adoption of this control by our customers. RadDateTimePicker was one of the most requested controls that we were lacking in the suite, but we did not expect this level of interest in it. Let me give you a little history on the control:

RadDateTimePicker
 was created to cover for the date/time picking functionality that is needed for a feature-rich RadCalendar. It is not an official control yet, because it still lacks the API, documentation and examples to make it a full blown control. As a matter of fact, we have not announced it in the Q2 2007 Release Notes, because the control was intended to be used with RadCalendar only.

It nevertheless appears in the VS ToolBox and I guess this fact alone is enough for you guys to start using it :). Why did we separate it from RadCalendar? Because it will be included in the WinForms suite at one point or another any way. So, we decided to blog that the DateTimePicker "comes as a bonus and demonstrates our willingness to deliver more than expected". Well, since the expectations about this control are very high, we will add some basic functionality to it in Q2 service packs, but will classify it as a beta, so that we do not raise our customer's expectations too high on its features at this time.

RadDateTimePicker will be officially released as a stand alone control in Q3 of RadControls for WinForms. With the Q3 release we will provide masked edit functionality as well, and then you will be able to change the fore color of the text box as it would be editable. 

I hope this sheds some light on the latest addition to RadControls for WinForms.

Feel free to write back in case you have any questions.
 

Greetings,
Boyko Markov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Arni
Top achievements
Rank 1
answered on 12 Nov 2008, 04:28 AM
               I am doing  a module calulating the work time of Emplyers set two Rddatetimepickers controls and calulate the time
I hv dn the function caluculationg the time difference  using Timespan and its working Properly.
            But I need to set validation to these controls Where the raddatetimepicker1 having the ateformat dd/MM/yyy HH:ss:mm and Start from curent date second Raddatetime picker should have the time greater than the starting time  atleast one min.How To set the calidation for these case.
kindly help me to validation these conr\trols and can send reference helplinks  fr this pblm. 
 Thank u all in Advance
0
Boyko Markov
Telerik team
answered on 18 Nov 2008, 05:20 PM
Hello Arni,

Have you tried to compare the DateTime values which you have in the datetimepickers? Every DateTimePicker has a Value property and you can use the following comparison: date1 < date2. You have also ValueChanging and ValueChanged events of the RadDateTimePickerElement which you can easily handle and make the appropriate comparisons. For example subscribe to the ValueChanging events and save the current values of your datetimepickers. Then in the ValueChanged compare the values and if the result isn't valid you can easily make Undo as you have the old values.

Please contact me if you have any problems with the implementation.

Greetings,
Boyko Markov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Arni
Top achievements
Rank 1
answered on 20 Nov 2008, 07:16 AM
 hello Boyko Markov ,
 I tried with with  the DAtetime picker Using the Simply  Javascript code
function StartDateSelected(sender, e)  
{  
var picker2 = $find("<%=RadDateTimePicker2.ClientID%>");  
var calendar1 =document.getElementById("<%=RadDateTimePicker1.ClientID%>").value;  
var calendar2 =document.getElementById("<%=RadDateTimePicker2.ClientID%>").value;  
    if (calendar2.length!=0)  
    {  
DateSelected();  
       
    }  
    else  
    {  
      picker2.get_dateInput().focus();       
    }  
}  
 
function DateSelected(sender, e)  
{  
var picker1 = $find("<%=RadDateTimePicker1.ClientID%>");  
var picker2 = $find("<%=RadDateTimePicker2.ClientID%>");  
var calendar1 =document.getElementById("<%=RadDateTimePicker1.ClientID%>").value;  
var calendar2 =document.getElementById("<%=RadDateTimePicker2.ClientID%>").value;  
  if ( calendar1.length!= 0 )  
 {  
    if(calendar1 > calendar2)  
       {  
       radalert("End Date Should Not be less from the Start Date",250,100,"Error Mesg");  
                    return false;  
       }  
      else if(calendar2 == calendar1)  
    {  
       radalert("End Time Should Not be less from the Start Time",250,100,"Error Mesg");  
        return false;  
    }  
   else if(calendar1 < calendar2)  
      {  
      
      }  
 }  
 else  
   
   radalert("PLease Insert Start Date");  
   picker1.get_dateInput().focus();    
      
}  

and called these functions to the Datetime pickers ..using Client Events under on dateselected Events for  both the controls

<

 

ClientEvents __designer:dtid="281474976710672" OnDateSelected ="StartDateSelected" />//for the Start time
<ClientEvents __designer:dtid="281474976710672" OnDateSelected ="DateSelected" /> // For the End time..
I could setthe validation of the dates..

 

protected void DayTimeworked()   
{  
string st1 = RadDateTimePicker1.DbSelectedDate.ToString();   
string st2 = RadDateTimePicker2.DbSelectedDate.ToString();   
DateTime dt3 = Convert.ToDateTime(st1);   
DateTime dt4 = Convert.ToDateTime(st2);   
TimeSpan tsp1 = dt4.Subtract(dt3);   
Label5.Text = tsp1.Days.ToString() +   
":" + tsp1.Hours.ToString() + ":" + tsp1.Minutes.ToString() + ":" + tsp1.Seconds.ToString();   
}  
protected void RadDateTimePicker1_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)   
{  
if(RadDateTimePicker1.SelectedDate != null)   
{  
if (RadDateTimePicker2.SelectedDate != null)   
{  
DayTimeworked();  
}  
}  
else    
Label5.Visible =   
false;   
}  
like this way i hv done  calulating the time difference and validation for the datetime picker control.Finaly I done it .  
Any one can Suggest If the same  events can handled easier .   
Thank  U  MR.Boyko Markov  

 

 

 


0
Boyko Markov
Telerik team
answered on 24 Nov 2008, 08:58 AM
Hi Arni,

Thank you about writing me. However I think your question is not for the RadDateTimePicker for WinForms product. I think you should post your ticket to the ASP.NET AJAX forum.  Here is a link to the calendar control's forum for ASP.NET AJAX - calendar forum

I hope this helps.

Please do not hesitate to contact me again if you have any questions regarding RadControls for WinForms.

Sincerely yours,
Boyko Markov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
DateTimePicker
Asked by
Louis
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Arni
Top achievements
Rank 1
Share this question
or