Changing day colors server side

2 posts, 0 answers
  1. Scott
    Scott avatar
    7 posts
    Member since:
    Oct 2015

    Posted 12 Nov 2015 Link to this post

    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?  

  2. Scott
    Scott avatar
    7 posts
    Member since:
    Oct 2015

    Posted 12 Nov 2015 in reply to Scott Link to this post

    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.

      

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top