I am trying to work on a scheduler interface that will allow a user to enter appointments.
The system is working when I apply no filter and load data through the following:
try
{
entities.Appointments.Load();
schedulerBindingDataSource1.EventProvider.DataSource = entities.Appointments.Local.ToBindingList();//filteredAppointmentsByLocation;
this.radScheduler1.DataSource = schedulerBindingDataSource1;
}
The above works and allows me to add, edit and delete without issues.
If I try to add a filter to get specific information:
var filteredAppointmentsByLocation = entities.Appointments.Local.ToBindingList().Where(x => x.LocationID.Equals(ActiveLocation));
and set this as the datasource, I cannot add new items when I do entities.SaveChanges(). I get an error saying it cannot add to a read-only or fixed-size list. Edits are saved, deletes are not done.
Please advise