Changing GroupBy at runtime

2 posts, 0 answers
  1. Simon
    Simon avatar
    26 posts
    Member since:
    Jul 2011

    Posted 06 Sep 2011 Link to this post

    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
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 07 Sep 2011 Link to this post

    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 >>

Back to Top