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

Dynamically change HeaderFormat

1 Answer 22 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
David A.
Top achievements
Rank 1
David A. asked on 11 Feb 2012, 03:56 PM
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";
        }

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 15 Feb 2012, 05:11 PM
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 >>
Tags
Scheduler and Reminder
Asked by
David A.
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or