Hi!
I'm new in ASP.NET, so excuse me for stupid question, but i really don't understand.
I tried to work with RadSheduler by this tutorial. And everything is ok, but i don't understand, why when i ran an application, it gives me an error "The name 'appointments' does not exist in the current context" =/
Best wishes,
Roman
I'm new in ASP.NET, so excuse me for stupid question, but i really don't understand.
I tried to work with RadSheduler by this tutorial. And everything is ok, but i don't understand, why when i ran an application, it gives me an error "The name 'appointments' does not exist in the current context" =/
Best wishes,
Roman
7 Answers, 1 is accepted
0
Hi Roman,
Can you send us a small working demo of the problem which we can test locally? To attach files, you will need to open a support ticket.
Greetings,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Can you send us a small working demo of the problem which we can test locally? To attach files, you will need to open a support ticket.
Greetings,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
0
Accepted
Hi Roman,
Thanks for the demo. It helped us find out what the problem is. In the FindById helper function, "appointments" should be with capital A:
Appointments is the list defined by this code:
Best wishes,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for the demo. It helped us find out what the problem is. In the FindById helper function, "appointments" should be with capital A:
private AppointmentInfo FindById(string ID) |
{ |
foreach (AppointmentInfo ai in Appointments) |
{ |
if (ai.ID == ID) |
{ |
return ai; |
} |
} |
return null; |
} |
Appointments is the list defined by this code:
private List<AppointmentInfo> Appointments |
{ |
get |
{ |
List<AppointmentInfo> sessApts = Session[AppointmentsKey] as List<AppointmentInfo>; |
if (sessApts == null) |
{ |
sessApts = new List<AppointmentInfo>(); |
Session[AppointmentsKey] = sessApts; |
} |
return sessApts; |
} |
} |
Best wishes,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Roman
Top achievements
Rank 1
answered on 30 Jan 2009, 02:51 PM
Thank you very much!
0

Roman
Top achievements
Rank 1
answered on 30 Jan 2009, 03:42 PM
Excuse for my persistence, but only have understood with one problem as I had another. I tried to understand with her, reading lessons and looking through similar errors at a forum, but it has not helped me. Can you help me once more. My error:
Greetings,
Roman
Both DataSource and DataSourceID are defined on 'RadScheduler1'. Remove one definition.
My demo filesGreetings,
Roman
0
Accepted
Hi Roman,
The error message describes what the problem is. In Shedulet.ascx you set the DataSourceID:
And in code behind you set: RadScheduler1.DataSource = Appointments;
You should either set the DataSource or the DataSourceID property, but you cannot set both.
Kind regards,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The error message describes what the problem is. In Shedulet.ascx you set the DataSourceID:
<telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End" |
DataKeyField="ID" DataRecurrenceField="RecurrenceRule" |
DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="SqlDataSource1" |
And in code behind you set: RadScheduler1.DataSource = Appointments;
You should either set the DataSource or the DataSourceID property, but you cannot set both.
Kind regards,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Roman
Top achievements
Rank 1
answered on 03 Feb 2009, 12:32 PM
Thanks!