RadScheduler header text update

2 posts, 0 answers
  1. Karoon
    Karoon avatar
    1 posts
    Member since:
    Jun 2019

    Posted 23 Sep 2019 Link to this post

    Hi,

    I'm trying to update RadSheduler header text to show daily work hours. I'm implementing this from RadScheduler_ActiveViewChanged method, but the text is not changing unless I change active view. How can I resolve this issue?

    Thanks for help

    Karoon

    private void radScheduler1_ActiveViewChanged(object sender, SchedulerViewChangedEventArgs e)
            {
                toolWindow2.Text = e.NewView.ViewType.ToString();

                if (e.NewView is SchedulerDayViewBase)
                {
                    SchedulerDayViewBase dayViewBase = (SchedulerDayViewBase)e.NewView;
                  
                    dayViewBase.Scheduler.HeaderFormat = "ddd MMM dd";

                    UpdateRadSchedulerHeader(dayViewBase);
                }
            }

    I'm using the following line in UpdateRadSchedulerHeader method to update text:
    ((SchedulerHeaderCellElement)dayViewBase.Scheduler.ViewElement.Children[0].Children[j]).Text += "(Time 00:00:00)";

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4086 posts

    Posted 25 Sep 2019 Link to this post

    Hello, Karoon,   

    When you change the RadScheduler.HeaderFormat property, it is expected to affect the header cells' text immediately. You can specify the desired format when loading the form and initializing RadScheduler. The ActiveViewChanged event is expected to be fired when you change the view - from DayView to MonthView for example. Hence, initially it won't be fired until you switch to another view. 

    Note that you can customize the cells in RadScheduler and handle the CellFormatting event. Thus, you can change the text of the header cells as well.

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

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top