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

RadScheduler and ViewState

3 Answers 181 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
René De Blois
Top achievements
Rank 1
René De Blois asked on 22 Aug 2007, 07:30 PM

I have a problem when I disable the viewState for the RadScheduler.  I know it's not safe doing that but I want my page to be as light as possible. 

In the Page_load event, I load appointments from a database (on Init and Postback).  The problem I have is that I cannot retreive the new appointments in the scheduler after a postback.  If I check the Appointments collection, I don't have the new ones.

Can someone explain why I lost the new ones ?  I was thinking that it's on the LoadPostData that you retreive the new data from the control.  Do I miss something ?

    protected void Page_Load(object sender, EventArgs e)
    {
      // Check AppointmentCollection.  Always o element inside.
      AppointmentCollection appointments = RadScheduler1.Appointments;

      // Load Appointment
      DateTime now = DateTime.UtcNow;
      now = new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0);
      List<AppointmentInfo> appointments = new List<AppointmentInfo>();

      appointments.Add(new AppointmentInfo("Programmer le scheduler", now, now.AddHours(1)));

      RadScheduler1.DataKeyField = "ID";
      RadScheduler1.DataSubjectField = "Subject";
      RadScheduler1.DataStartField = "Start";
      RadScheduler1.DataEndField = "End";
      RadScheduler1.DataSource = appointments;
    }

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 23 Aug 2007, 11:40 AM
Hello René,

This behavior can be expected, as RadScheduler has neither declarative data source nor provider that it can use to propagate the changes back to the data source. In such scenario, the changes remain only in the Appointments collection, that is saved in the ViewState, so they are lost indeed. In order to support such scenario, we have provided events, that you can attach to in order to update your data source. Please, take a look at the example that demonstrates.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jagat
Top achievements
Rank 1
answered on 04 Mar 2016, 04:46 PM

That example link does not work. Can you update it?

 

Thanks

0
Nencho
Telerik team
answered on 07 Mar 2016, 01:04 PM
Hello Jagat,

The topic discussed in this thread is regarding our Classic controls, which are not longer supported. The link in question, showcases a demo, where biding to a Generic List approach is demonstrated. You can observe this implementation in the following online demo:

http://demos.telerik.com/aspnet-ajax/scheduler/examples/bindtolist/defaultcs.aspx


Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
René De Blois
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Jagat
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or