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

Changing day colors server side

1 Answer 11 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 12 Nov 2015, 03:35 PM

Hello

 I am trying to set different colors for specific days (only using MonthView) in the Scheduler based on some variables.

I am handling the TimeSlotCreated event:

 

Protected Sub calendar_TimeSlotCreated(sender As Object, e As TimeSlotCreatedEventArgs) Handles calendar.TimeSlotCreated
     If ScheduleDates.Contains(e.TimeSlot.Start) Then
        e.TimeSlot.CssClass = "lightSalmon"
     End If
End Sub

 I have another user control which is a dropdownlist of employees. When the dropdownlist fires the changed event, I populate a variable stored in ViewState with the dates that the employee is working. As I understand, the TimeSlotCreated event fires after the Page Load event, but before my other user control event fires. I need to change the colors of the days after my user control fires. I implemented a not-so-great solution, by calling the RadAjaxPanel to reload after the user control event fires.

 

Private Sub DDLEmployee_Changed(sender As Object, e As EventArgs) Handles DDLEmployee.EmployeeChanged
        PopulateSchedule()
        RadAjaxPanel1.ResponseScripts.Add(String.Format("$find('{0}').ajaxRequest();", RadAjaxPanel1.ClientID))
End Sub

 

The problem is that the RadAjaxPanel load fires twice so it looks like it's flickering. Is there any way to change the colors of days after any other events have fired?  

1 Answer, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 12 Nov 2015, 04:09 PM

I figured out how to fix that problem. Instead of forcing the RadAjaxPanel to reload, I called the Rebind() function on the Scheduler. Works like a charm.

  

Tags
Scheduler
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Share this question
or