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

RadScheduler header text update

1 Answer 105 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Karoon
Top achievements
Rank 1
Karoon asked on 24 Sep 2019, 12:05 AM

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)";

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Sep 2019, 06:40 AM

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.
Tags
General Discussions
Asked by
Karoon
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or