4 Replies - 5024 Views - Last Post: 09 August 2012 - 09:42 PM Rate Topic: -----

#1 mil1234  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 109
  • Joined: 01-February 09

Telerik DateTimepicker control

Posted 07 August 2012 - 09:26 AM

Hi to all,

when i put a telerik datetimepicker control on one of my view pages the control comes as i want it(a texbox that when the user presses on it a calendar opens and 2 icons nearby let you change between calendar and time picker)
<telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server">
                </telerik:RadDateTimePicker>
. The problem comes when i try to put the telerik control like the below line of code:
<%: Html.Telerik().DateTimePickerFor(model => model.EndDate)%>


This line creates a textbox but then near it instead of the 2 nice icons to switch between the calendar and time pickers there are 'Open calendar' and 'open time picker' written.....i searched a lot on this issue but i can't find a proper answer...is it maybe off some styles not being recognized when using the above line of code!!

Thanks to everyone....

Is This A Good Question/Topic? 0
  • +

Replies To: Telerik DateTimepicker control

#2 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,501
  • Joined: 28-April 09

Re: Telerik DateTimepicker control

Posted 07 August 2012 - 02:01 PM

Is this mvc or web forms?

If it's mvc you can usually look under Views/shares/edittemplates for the partial view that's rendering the telerik datetime control and make modifications to it
Was This Post Helpful? 1
  • +
  • -

#3 mil1234  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 109
  • Joined: 01-February 09

Re: Telerik DateTimepicker control

Posted 07 August 2012 - 10:47 PM

View PostNakor, on 07 August 2012 - 03:01 PM, said:

Is this mvc or web forms?

If it's mvc you can usually look under Views/shares/edittemplates for the partial view that's rendering the telerik datetime control and make modifications to it



Yes its MVC....i went in views/shares/editor etc and found <%= Html.Telerik().DateTimePickerFor(m => m) %>. But what changes does it need? i can't find any info on how i can fix this problem...if it is of help i attached a screenshot here with the datetime control as it's coming and below it exactly how i would like it!!!

Thanks mate...

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#4 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,501
  • Joined: 28-April 09

Re: Telerik DateTimepicker control

Posted 08 August 2012 - 05:31 AM

hmm, I thought there was a setting for it but i'm not finding it now. Another possibility would be that the stylesheet for the datetimepicker is not loading correctly. Look on your layout page and check to see what stylesheets are being loaded by Telerik. (views->shared->layout.aspx or something like that)

There should be a line similar to

@(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.black.css").Combined(true).Compress(true)))



somewhere on the layout page. Telerik default for their controls is text, then everything gets styled by their javascript while the page is loading, but if the stylesheet isn't loading correctly then the style will not get applied which sounds like what might be happening here.
Was This Post Helpful? 1
  • +
  • -

#5 mil1234  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 109
  • Joined: 01-February 09

Re: Telerik DateTimepicker control

Posted 09 August 2012 - 09:42 PM

Hello Nakor,

i tried adding the line of code you shown me in the prevoius page to several parts etc but to no avail. As you said it seems some styling problem but then at the same time how when adding the control this way on the same page the styling is correct:
<telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server">
                </telerik:RadDateTimePicker>


What i was thinking is to add the ' ID="RadDateTimePicker2" ' to my line of code:
<%: Html.Telerik().DateTimePickerFor(model => model.EndDate)%>


Have you idea how this can be done?

Tnx mate..

This post has been edited by mil1234: 09 August 2012 - 09:43 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1