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

Scheduler's selected date

5 Answers 220 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 27 Dec 2011, 01:37 PM
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.

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Dec 2011, 01:55 PM
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
0
Stefan
Top achievements
Rank 1
answered on 27 Dec 2011, 02:03 PM
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.
0
Peter
Telerik team
answered on 27 Dec 2011, 02:20 PM
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
0
Stefan
Top achievements
Rank 1
answered on 27 Dec 2011, 02:51 PM
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.
0
Peter
Telerik team
answered on 28 Dec 2011, 12:38 PM
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
Tags
Scheduler
Asked by
Stefan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Stefan
Top achievements
Rank 1
Share this question
or