Scheduler's selected date

6 posts, 0 answers
  1. Stefan
    Stefan avatar
    8 posts
    Member since:
    Jan 2011

    Posted 27 Dec 2011 Link to this post

    Dear Telerik,

    I use the RadScheduler with the web service data binding model. Day view only.

    When I switch between the days it does not make postback of the page to the server (which is great!).

    But later I still need to make a post back and get the current selected date from the code behind of the page.

    I see that the value of  myScheduler.SelectedDate remains the same as it used to be after the page has been first loaded and does not reflect the fact that I was moving the scheduler to another day...

    How can I get the correct date though?

    Thank you in advance!

    - Stepan.

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 27 Dec 2011 Link to this post

    Hi Stepan,

    This is expected since when you navigate and there is no postback, the ViewState is not changed so when real postback happens, RadScheduler loads its initial state. As a workaround, you can store the selected date in a cookie by handling OnClientNavigationComplete. Then you can handle the client pageLoad() event to set the selected date via the set_selectedDate() method from the cookie. Please, let me know if this is a viable alternative for your case and if you need more help with it.

    Kind regards,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Stefan
    Stefan avatar
    8 posts
    Member since:
    Jan 2011

    Posted 27 Dec 2011 Link to this post

    Hi, Peter!

    Thank you for the fast response!

    I did use a similar thing, but I chose hidden field as a temporary storage for the "real" selected date.

    Can I ask another question from the same context?

    When I move between the days I see how the appointments reload using the correct date. But the resources of the scheduler - do not. Is it possible to make the resources to reload as well?
    It is an important issue because in my case the resources (employees in charge) differ from day to day and mapping the correct appointments to the scheduler with the set of resources from say yesterday just give an empty grid - no appointments find their resource and simply don't show...

    - Stepan.
  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 27 Dec 2011 Link to this post

    Hello Stepan,

    I am not sure what exactly you need to achieve, so I am sending you three different samples. I hope you find the functionality that you need in one of them.

    Kind regards, Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Stefan
    Stefan avatar
    8 posts
    Member since:
    Jan 2011

    Posted 27 Dec 2011 Link to this post

    Hi, Peter.

    Let me clarify in more details what I'm trying to achieve.

    Imagine it is a school time-table ranged by teachers and time. Day view only. Appointments (classes) have only one resource type: Teachers. Thus,  teachers are shown in the top of the scheduler. By them the appointments are groopped.

    Today the teachers Simmonds, Smith and Barns work, tomorrow - La Salle, Novikov and Silverman.

    When the page is first load with today's selected date I see Simmonds, Smith and Barns at the top and their classes in the body of the scheduler. That's fine. When I click next day, the web service providing data provides appointments for the nex day, but do not provide resource values for the next day. Thus I still see Simmonds, Smith and Barns in the top of the scheduler and none of the classes under them, because all the classes (appointments) returned by the web service belong to La Salle, Novikov and Silverman. They don't find their resource values and do not show.

    If the resource values refreshed as well as the appointmnets (as the do in the first load of the page) all would be fine.

    Is it impossible?

    - Stepan.
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 28 Dec 2011 Link to this post

    Hello,

    In case of WebService binding, we have two major conditions regarding binding of resources - the selected view is Grouped By Resource or it's not. If the view is resource-grouped, then the header and content tables rendering changes from the default (non-grouped). In order to restrain the complexity of this rendering in a single place (it will require a lot of work to duplicate this rendering at the client side and most likely it will be a performance issue there), the development team decided to perform such rendering only at the server.

    This means that if the view is resource-grouped, resources are needed server-side => (therefore) the server needs to bind all resource types from the WebService. These conditions are represented as ResourcePopulationMode.

    The bottom line is that with Web Service binding, you cannot change the way RadScheduler has rendered without a postback. The resource columns will not change when you navigate through RadScheduler, only appointments will populate with client rendering. The closest to your requirement I think is the SchWsChangeResColumns.zip sample I sent you in the previous post.

    Greetings, Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top