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

Edit not woking for Scheduler / Resource Availability

1 Answer 50 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 17 Jan 2011, 04:57 PM

Hi,
I am working on Scheduler / Resource Availability. Facing problem while editing appointment.
Description :
My scheduler contains 3 rooms "Room1,Room2,Room3", In that "Room2" contains two appointments "Schedule Lesson1" and "Schedule Lesson2", Now when I edit "Schedule Lesson1" appointment,it show me correct information such Subject,StartTime,EndTime etc. But when I try to edit "Schedule Lesson2" appointment it show Incorrect Information (same information as first "Schedule Lesson1" Appointment).

Please check attached screen shots...

Here is my code :

protected void Page_Load(object sender, EventArgs e)
    {
        DataTable tblTest = new DataTable();
        tblTest.Columns.Add("ID");
        tblTest.Columns.Add("RoomID");
        tblTest.Columns.Add("startdate");
        tblTest.Columns.Add("enddate");
        tblTest.Columns.Add("Subject");      
        DataRow drTest;
        drTest = tblTest.NewRow();
        drTest["ID"] = 2;
        drTest["RoomID"] = 2;
        drTest["startdate"] = "2011-01-11 10:00:00.000";
        drTest["enddate"] = "2011-01-11 12:00:00.000";
        drTest["Subject"] = "Scheduled Lesson1";     
        tblTest.Rows.Add(drTest);
  
        drTest = tblTest.NewRow();
        drTest["ID"] = 2;
        drTest["RoomID"] = 2;
        drTest["startdate"] = "2011-01-11 14:00:00.000";
        drTest["enddate"] = "2011-01-11 16:00:00.000";
        drTest["Subject"] = "Scheduled Lesson2";       
        tblTest.Rows.Add(drTest);
  
        drTest = tblTest.NewRow();
        drTest["ID"] = 3;
        drTest["RoomID"] = 3;
        drTest["startdate"] = "2011-01-11 12:00:00.000";
        drTest["enddate"] = "2011-01-11 14:00:00.000";
        drTest["Subject"] = "Scheduled Lesson3";      
        tblTest.Rows.Add(drTest);
  
        drTest = tblTest.NewRow();
        drTest["ID"] = 4;
        drTest["RoomID"] = 4;
        drTest["startdate"] = "2011-01-11 12:00:00.000";
        drTest["enddate"] = "2011-01-11 14:00:00.000";
        drTest["Subject"] = "Scheduled Lesson4";      
        tblTest.Rows.Add(drTest);
  
  
        DataTable RoomDataSource = new DataTable();
        RoomDataSource.Columns.Add("ID");
        RoomDataSource.Columns.Add("RoomName");   
      
        DataRow drRoom1;
        drRoom1 = RoomDataSource.NewRow();
        drRoom1["ID"] = 1;
        drRoom1["RoomName"] = "Room 1";       
        RoomDataSource.Rows.Add(drRoom1);
  
        DataRow drRoom2;
        drRoom2 = RoomDataSource.NewRow();
        drRoom2["ID"] = 2;
        drRoom2["RoomName"] = "Room 2";
        RoomDataSource.Rows.Add(drRoom2);
  
        DataRow drRoom3;
        drRoom3 = RoomDataSource.NewRow();
        drRoom3["ID"] = 3;
        drRoom3["RoomName"] = "Room 3";
        RoomDataSource.Rows.Add(drRoom3);
  
        RadScheduler2.ResourceTypes[0].DataSource = RoomDataSource;
        RadScheduler2.DataSource = tblTest;
        RadScheduler2.DataBind();
    }

Please reply as soon as possible.It's very urgent.


Thanks,
Rahul



1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 18 Jan 2011, 09:53 AM
Hello Rahul,

The reason for the issue is that you are creating two appointments "RadScheduler Lesson1" and "RadScheduler Lesson2" with one and the same ID:

DataTable tblTest = new DataTable();
        tblTest.Columns.Add("ID");
        tblTest.Columns.Add("RoomID");
        tblTest.Columns.Add("startdate");
        tblTest.Columns.Add("enddate");
        tblTest.Columns.Add("Subject");      
        DataRow drTest;
        drTest = tblTest.NewRow();
        drTest["ID"] = 1;
        drTest["RoomID"] = 2;
        drTest["startdate"] = "2011-01-11 10:00:00.000";
        drTest["enddate"] = "2011-01-11 12:00:00.000";
        drTest["Subject"] = "Scheduled Lesson1";     
        tblTest.Rows.Add(drTest);

Please edit the ID of the first appointment to "1" as in the code above.

Kind regards,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
Rahul
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or