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

Synchronizing of RadGrid and RadScheduler

2 Answers 109 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 17 Feb 2012, 04:01 PM
Hello Telerik team,
I have a little problem synchronizing a RadGrid and a RadScheduler control. In my project I use a RadScheduler control and a RadGrid control. There the RadGrid control contains all appointments in a list form (only with fields Start, End and Subject) which are displayed in the selected view of the scheduler control.

To use Ajax, both, the RadScheduler and the RadGrid control are inside AjaxSettings.

I'm using an own SchedulerProviderClass and in the code behind the right event handler (OnNeedDataSource and OnNavigationComplete).

My problem is now the following:

If I use the navigation controls of the RadScheduler control the events are fired in the follwowing order:

1. OnNeedDataSource of the RadGrid control will be called
2. OnNavigationComplete of the RadScheduler controll will be called
3. OnDataBound of the RadScheduler control will be called

somtimes (e.g. when changing the view type) the event order is like this:

1. OnNeedDataSource of the RadGrid control will be called
2. OnDataBound of the RadScheduler control will be called
3. OnNavigationComplete of the RadScheduler controll will be called
4. OnDataBound of the RadScheduler control will be called

This order causes me some problems because in the OnNeedDataSource handler I load all appointments from the database DEPENDING on the selected view type AND the selected date of the RadScheduler control.

But since the OnNeedDataSource event is called BEFORE the OnNavigationComplete event, my data in the RadGrid control will be wrong. For example if I navigate one day forward in the DayView, OnNeedDataSource will be called and the SelectedDate of the RadScheduler contains the current day, NOT the next day.

Is there a way, to set the order of the events?

To get for sure that the OnNeedDataSource event will be raised AFTER the OnNavigationComplete event?

Yours sincerely,
Richard Huber-

2 Answers, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 22 Feb 2012, 11:53 AM
Hi Richard,

You can handle the RadGrid's data binding in the NavigationComplete event of RadScheduler. You can refer to the attached sample project for more information how this could be achieved.

I hope it helps.

Kind regards,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Richard
Top achievements
Rank 1
answered on 22 Mar 2012, 01:34 PM
hi Ivana,
sorry for the late response (some completly different projects came my way). Your idea helped, I could solve my problem. Strictly speaking I do no longer use an OnNeedDataSource handler for the rad grid. Instead of I reload the data grid in the DataBound event handler of the scheduler control, which works fine.

Thanks,
Richard.
Tags
Scheduler
Asked by
Richard
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Richard
Top achievements
Rank 1
Share this question
or