How to Set Appointment BackColor after a Search

1 Answer 80 Views
Scheduler and Reminder
Martin Hamilton
Top achievements
Rank 1
Iron
Iron
Veteran
Martin Hamilton asked on 20 Jan 2023, 03:20 PM

I'm able to find an appointment from a search box using the following code.

    Private Sub FindAppointment()
        For Each app As Appointment In SalesOrdersSchedule.Appointments
            If app.Subject.Contains(searchTextBox.Text) Then
                SalesOrdersSchedule.ActiveView.StartDate = app.Start
                SalesOrdersSchedule.SchedulerElement.InvalidateMeasure(True)
                SchedulerUIHelper.BringAppointmentIntoView(app, SalesOrdersSchedule)
                UcSalesOrderLine1.RefNumber = searchTextBox.Text
                UcSalesOrderLine1.lblHeader.Text = GridHeaderHTMLBegin & $"Sales Order Items For {app.Summary} ShipDate: {app.Description}" & GridHeaderHTMLEnd
                UcSalesOrderLine1.LoadGrid()
                Exit For
            End If
        Next
    End Sub

The BringAppointmentIntoView works just fine - but I need the appointment that has been found to change color so the user can find it amongst all of the other appointments showing for that week.

Is there a way I can change the back color or otherwise highlight the appointment and if so, how can I reset it when the user performs a search for another appointment?

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Jan 2023, 11:44 AM
Hello, Martin,

The appropriate way to customize the appointment elements is the AppointmentFormatting event: https://docs.telerik.com/devtools/winforms/controls/scheduler/appearance/formatting-appointments 

The SchedulerAppointmentEventArgs.Appointment gives you access to the data event so you can mark some specific appointments and then in the AppointmentFormatting event customize the style of the respective visual AppointmentElement. If you need to force refreshing the appointment elements and fire the AppointmentFormatting event, it is appropriate use the SchedulerElement.RefreshViewElement method.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Scheduler and Reminder
Asked by
Martin Hamilton
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or