Hi All,
I'm new to the Telerik comunity and control suite, and after seeing the demo's of the RadScheduler i was blown awa. I've started evaluating whether this control will be able to be encorporated into our creaking architecture and in doing that i've come across a problem i can't quite get my head around. Please note that this is currently using the default XML file for the data provider (i haven't got round to using our database yet).
I've put the following code in the ASPX page:
And the following code in the code behind (this is to programmatically add our items to the dropdown, it will be from a database but i'm hardcoding this to mock this for testing purposes).
The 'Priority' field now appears as a drop down, as does the S7User, these save too perfectly into the 'Appointments.xml' file, but, when i try to reopen the calendar i get the error:
The XML that is saved in the 'Appointments.xml' file is as follows:
Can anyone offer any guidance as to why this is happening please? It works when I have the resources in the XML file, but taking them out breaks it, even though they are added to the control. One thing to note is in the Page_Init they are added to the 'Resources' collection in the control.
Any help is greatly appreciated.
Iain
I'm new to the Telerik comunity and control suite, and after seeing the demo's of the RadScheduler i was blown awa. I've started evaluating whether this control will be able to be encorporated into our creaking architecture and in doing that i've come across a problem i can't quite get my head around. Please note that this is currently using the default XML file for the data provider (i haven't got round to using our database yet).
I've put the following code in the ASPX page:
<
telerik:RadScriptManager
ID
=
"sman"
runat
=
"server"
EnableTheming
=
"false"
/>
<
telerik:RadScheduler
ID
=
"radCalendar"
runat
=
"server"
AdvancedForm-Enabled
=
"true"
StartEditingInAdvancedForm
=
"true"
StartInsertingInAdvancedForm
=
"true"
/>
And the following code in the code behind (this is to programmatically add our items to the dropdown, it will be from a database but i'm hardcoding this to mock this for testing purposes).
protected void Page_Init(object sender, EventArgs e)
{
ResourceType priority = new ResourceType("PriorityLevel");
radCalendar.ResourceTypes.Add(priority);
radCalendar.Resources.Add(new Resource("PriorityLevel", 1, "Low"));
radCalendar.Resources.Add(new Resource("PriorityLevel", 2, "High"));
ResourceType user = new ResourceType("S7User");
radCalendar.ResourceTypes.Add(user);
user.AllowMultipleValues = true;
radCalendar.Resources.Add(new Resource("S7User", 8, "Iain"));
radCalendar.Resources.Add(new Resource("SUser", 9, "Nick"));
radCalendar.Resources.Add(new Resource("S7User", 10, "Paul"));
radCalendar.Resources.Add(new Resource("S7User", 11, "Stephan"));
radCalendar.Provider = new XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), true);
}
The 'Priority' field now appears as a drop down, as does the S7User, these save too perfectly into the 'Appointments.xml' file, but, when i try to reopen the calendar i get the error:
Cannot find resource of type 'PriorityLevel' with Key=1 for appointment with ID=41.
The XML that is saved in the 'Appointments.xml' file is as follows:
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
Appointments
>
<
NextID
>42</
NextID
>
<
Appointment
>
<
ID
>41</
ID
>
<
Subject
>asdfasdf</
Subject
>
<
Start
>2011-06-15T09:30Z</
Start
>
<
End
>2011-06-15T10:30Z</
End
>
<
Resources
>
<
PriorityLevel
Key
=
"1"
/>
<
S7User
Key
=
"8"
/>
</
Resources
>
</
Appointment
>
</
Appointments
>
Can anyone offer any guidance as to why this is happening please? It works when I have the resources in the XML file, but taking them out breaks it, even though they are added to the control. One thing to note is in the Page_Init they are added to the 'Resources' collection in the control.
Any help is greatly appreciated.
Iain