Issues when set the schduler selecd date in page load

2 posts, 0 answers
  1. Harikrishnan
    Harikrishnan avatar
    21 posts
    Member since:
    Jul 2012

    Posted 21 Jan 2013 Link to this post

    Hi

    I am facing a big issue,

    When we set the scheduler selecteddate in page load by another date picked which located in the same page, That time all the appoints are went to invisible..y this happnd.....?

    Am using vb.net ..

    any idea?pls help me its urg

    RadScheduler1.SelectedDate= rdDatePicker.SelectedDate

     

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 24 Jan 2013 Link to this post

    Hello,

    Indeed there is a problem because the RadDatePicker control returns a type of DateTime?(nullable). The RadScheduler SelectedDate works with DateTime type and some additional modifications are required as shown in the code snippet below:
    //markup code
    <telerik:RadScheduler ID="RadScheduler1" runat="server"></telerik:RadScheduler>
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" AutoPostBack="true" SelectedDate="2002 11 22"></telerik:RadDatePicker>
    //code behind
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     
        If RadDatePicker1.SelectedDate IsNot Nothing Then
            Dim datePickerDate As Long = RadDatePicker1.SelectedDate.Value.Ticks
            Dim currentDate As New DateTime(datePickerDate)
            RadScheduler1.SelectedDate = currentDate
        End If
     
    End Sub

    Regards,
    Boyan Dimitrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top