Dynamically change HeaderFormat

2 posts, 0 answers
  1. David A.
    David A. avatar
    126 posts
    Member since:
    Aug 2008

    Posted 11 Feb 2012 Link to this post

    Hi,

    I have a long HeaderFormat string for day view but when I change the ActiveView I would like to change the HeaderFormat to a shorter string such as mm/dd.  I tried this in the ActiveViewChanged by doing the following without any luck.

    Is it possible to do this?

    Thank you.
    David

    private void Scheduler_ActiveViewChanged(object sender, SchedulerViewChangedEventArgs e)
            {
     
                if (e.NewView.ViewType == SchedulerViewType.Week)
                    Scheduler.GetWeekView().HeaderFormat = "mm/dd";
            }
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 15 Feb 2012 Link to this post

    Hello David,

    Thank you for your question.

    Yes, it is possible to achieve this. To do so, you should use the HeaderFormat property of the RadScheduler control instead. The following code snippet demonstrates this.
    void radScheduler1_ActiveViewChanged(object sender, SchedulerViewChangedEventArgs e)
    {
        if (this.radScheduler1.ActiveViewType == SchedulerViewType.Week)
        {
            this.radScheduler1.HeaderFormat = "dd mm";
        }
        else
        {
            this.radScheduler1.HeaderFormat = "dd dddd";
        }
    }

    Please let me know if you have any additional questions.

    All the best,
    Ivan Todorov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top