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();
}
}