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

Changing GroupBy at runtime

1 Answer 97 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 06 Sep 2011, 07:16 AM
Hey Guys,

Got a scenario here where I want to change the GroupBy on my Scheduler resources.
I want to do this for two reasons:
1. I have resource filters, and when all filters are off, and the scheduler tries to render grouped, empty views, it gives a javascript error.
2. I only want groupby set to my (single) resource when in Day view - I want to turn off for Weekly and Monthly.

Now if I tap into OnNavigationCommand I can set this and it works great - however the "More" link in monthly view does not fire OnNavigationCommand and this leaves grouping turned off when it switches back to Day view.

I guess I have two questions here:
Q1 How can I trap the "more" button and change the GroupBy without causing a "not allowed in data binding phase" error?
and
Q2 Is there a way to suppress the empty-grouped by errors? (If Q1 is answered then I'll simply turn groupBy off when no records present)

thanks

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 07 Sep 2011, 02:25 PM
Hello Simon,

The NavigationCommand will still occur when you click on the more link, but the Command will be
'SwitchToSelectedDay' -

protected void RadScheduler1_NavigationCommand(object sender, SchedulerNavigationCommandEventArgs e)
   {
       if (e.Command == SchedulerNavigationCommand.SwitchToSelectedDay)
       {
            
       }
   }



Regards,
Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Scheduler
Asked by
Simon
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or