Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > RadScheduler Search w/Open

Not answered RadScheduler Search w/Open

Feed from this thread
  • jeff357 avatar

    Posted on Dec 9, 2011 (permalink)

    Hi ALL,
        I want to impliment search to radscheduler and
    OPEN the Appointment that the text is in how to do?
                                                  Any Help Apperciated!
                                                             Jeff Link

       
    Private Sub RadButton3_Click(sender As System.Object, e As System.EventArgs) Handles RadButton3.Click
            If RadTextBox.Text = "" Then
                MessageBoxEx.ButtonsDividerVisible = False
                MessageBoxEx.Show("Please Enter some text to search for!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            Else
                FindAppointment()
            End If
     
        End Sub
     
        Private Sub FindAppointment()
     
     
            For Each app As Appointment In Me.RadScheduler1.Appointments
     
     
                If app.Subject.Contains(Me.RadTextBox.Text) Or app.Location.Contains(Me.RadTextBox.Text) Or app.Description.Contains(Me.RadTextBox.Text) Then
     
                    Me.RadScheduler1.ActiveView.StartDate = app.Start
     
                    Me.RadScheduler1.SchedulerElement.InvalidateMeasure(True)
     
                    SchedulerUIHelper.SelectAppointment(Me.RadScheduler1, app, True)
     
                    Exit For
     
                End If
            Next
        End Sub
              

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Dec 13, 2011 (permalink)

    Hi Jeff357,

    Thank you for your question.

    There is a protected method in RadScheduler called ShowAppointmentEditDialog which opens a specified appointment in the EditAppointmentDialog. You can either inherit from RadScheduler and expose a public method to call the ShowAppointmentEditDialog method or you can use reflection to call it directly. It accepts as arguments the appointment to be opened and a boolean value indicating whether the recurrence editor should also be opened. For you convenience, this method will be exposed as public in the next official release.

    As to your question about the case insensitive search, which you asked in another thread, you can use the IndexOf method instead of the Contains method to check if a given string is contained within another. The following code snippet implements both of your requirements:
    Private Sub FindAppointment()
        For Each app As Appointment In Me.RadScheduler1.Appointments
     
            If app.Subject.IndexOf(Me.RadTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0 OrElse
                app.Location.IndexOf(Me.RadTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0 OrElse
                app.Description.IndexOf(Me.RadTextBox.Text, StringComparison.OrdinalIgnoreCase) >= 0 Then
     
                Me.RadScheduler1.ActiveView.StartDate = app.Start
                Me.RadScheduler1.SchedulerElement.InvalidateMeasure(True)
                SchedulerUIHelper.SelectAppointment(Me.RadScheduler1, app, True)
                Dim mi As MethodInfo = GetType(RadScheduler).GetMethod("ShowAppointmentEditDialog", BindingFlags.Instance Or BindingFlags.NonPublic)
                mi.Invoke(Me.RadScheduler1, New Object() {app,False})
                Exit For
     
            End If
        Next
    End Sub

    I hope you find this helpful. Feel free to ask if you have any additional questions.

    Kind regards,
    Ivan Todorov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > RadScheduler Search w/Open
Related resources for "RadScheduler Search w/Open"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]