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

Getting appointments based om given id, - LINQ

1 Answer 30 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jill-Connie Lorentsen
Top achievements
Rank 1
Jill-Connie Lorentsen asked on 08 Jun 2012, 09:44 AM

Hi!

I am new to asp, so please excuse me if I don't express myself correctly.

I have a RadScheduler with a Linq data source. I want to get appointments from the database based on a given id.

In my DataClasses.dbml I have four tables and (for now) two stored procedures, GetProgram() and GetProgramById(int id). The user chooses the id from a checkboxlist, and I want to call the GetProgramById(int id) from codebehind. 

In markup I have configured the RadScheduler with DataSourceID="ProgramDataSource". I try to set the data source property to the result of the GetProgramById(int id), but then I get an error saying that both DataSourceID and DataSource properties are set, and that I have to remove one of them. If I remove  DataSourceID="ProgramDataSource" from markup I can set DataSource=GetProgrambyID(int id), but then none of the appointments are updated to the database after closing the AdvancedEdit form of the scheduler.

There must be a way to get a subset of the appointments, and to be able to edit them, so I would be greatful if anyone could help me find it.

Thank you!

Regards, Jill-Connie Lorentsen

protected void RadListBoxTmp_ItemCheck(object sender, RadListBoxItemEventArgs e)
   {
 
       int id;        
       bool result = Int32.TryParse( e.Item.Value, out id);
       if ( e.Item.Checked && result)
       {
           var dataContext = new DataClassesDataContext();
           ProgramDataManager dataManager = 
                   new ProgramDataManager((SqlConnection)dataContext.Connection);
 
           var program = new List<GetProgramByIDResult>();
           program = dataManager.GetProgramByID(id);
 
            
           RadScheduler1.DataSource = program;
           RadScheduler1.Rebind(); 
       }
         
   }

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 13 Jun 2012, 07:33 AM
Hello Jill,

 
From the explanation of the issue it is a little complicated to provide a solution. That is why I prepared a sample project that contains a RadScheduler bound to Linq. Would you please review it let us know what is the code that should be added to it in order to reproduce the same unusual behavior that you are facing locally? This way we could inspect the issue and be more here helpful.
 

Greetings,
Plamen Zdravkov
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
Jill-Connie Lorentsen
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or