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

[Solved] RadScheduler and dropdownlist

1 Answer 179 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
sreedevi
Top achievements
Rank 1
sreedevi asked on 08 Apr 2008, 08:19 PM

On my web page I have a Scheduler and a dropdown. I need to rebind a new set of data to the scheduler on the dropdown SelectedIndexChanged event based on selected value from the dropdown list. My scheduler works fine when I bind the datatable to scheduler on the page_load event for the first time. But when I rebind the new set of data on dropdown SelectedIndexChanged event, the scheduler is empty; though I have 100s of records exists in the new datatable. Is it happening because I am missing something?.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then

            CounselorName()

        End If

            RadScheduler1.DataSource = getAppointments

End Sub

Private ReadOnly Property getAppointments() As DataTable

        Get

            Dim dt As DataTable = CType(Session(AppointmentsKey), DataTable)

            If dt Is Nothing Then

                dt = CreateDataTable()

                Session(AppointmentsKey) = dt

            End If

            Return dt

        End Get

End Property

Private Function CreateDataTable() As DataTable

        Dim dt As New DataTable

        Dim repAppt As New _APPT()

        repAppt.LoadApptsbyRepID(RepId)

        dt = repAppt.DefaultView.Table

        Return dt

End Function

Protected Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

        Dim schedule As New _APPT()

        Dim item As String = Me.ListBox1.SelectedItem.Text()

        RepId = Me.ListBox1.SelectedValue()

        Session(AppointmentsKey) = Nothing

        RadScheduler1.DataSource = getAppointments

End Sub

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Apr 2008, 05:30 PM
Hi Sreedevi,

Please, call the DataBind() method of RadScheduler in the SelectedIndexChanged event.
Protected Sub ListBox1_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged  
 
        Dim schedule As New REP_APPT()  
 
        Dim item As String = Me.ListBox1.SelectedItem.Text()  
 
        RepId = Me.ListBox1.SelectedValue()  
 
        Session(AppointmentsKey) = Nothing 
 
        RadScheduler1.DataSource = getAppointments  
          
        RadScheduler1.DataBind()  
 
End Sub 
 


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
sreedevi
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or