3 Answers, 1 is accepted
0
Hi Vanja,
Please check this help article - it demonstrates how to load appointments in the RadScheduleView using MVVM approach. You can add your logic for parsing the XML file without a problem.
Hope this helps.
Greetings,
Yana
the Telerik team
Please check this help article - it demonstrates how to load appointments in the RadScheduleView using MVVM approach. You can add your logic for parsing the XML file without a problem.
Hope this helps.
Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Vanja
Top achievements
Rank 1
answered on 02 Jun 2011, 09:44 AM
Can you please help me with adding appointment from code.. This is my code in C#.. I have" ObservableCollection<ResourceType> ResourcesTypes" as ScheduleView groups so I want to add appointments in that groups with "ObservableCollection<Appointment> Appointments"..
Here is my code...
Groups:
I tried to add appointment in group like this but its not working..
Don't know how to add appointment in ResourcesTypes ??
Here is my code...
Groups:
private
ObservableCollection<ResourceType> GenerateResourceTypes()
{
ObservableCollection<ResourceType> result =
new
ObservableCollection<ResourceType>();
ParseXML();
ResourceType kanal =
new
ResourceType(
"Kanal"
);
for
(
int
i = 0; i < KanalList.Count; i++)
{
Resource imekanala =
new
Resource(KanalList[i]);
kanal.Resources.Add(imekanala);
}
result.Add(kanal);
return
result;
}
public
MyViewModel()
{
ResourcesTypes = GenerateResourceTypes();
Appointments =
new
ObservableCollection<Appointment>();
}
I tried to add appointment in group like this but its not working..
public
ObservableCollection<Appointment> Appointments {
get
;
set
; }
public
ObservableCollection<ResourceType> ResourcesTypes {
get
;
set
; }
private
ObservableCollection<ResourceType> GenerateResourceTypes()
{
ObservableCollection<ResourceType> result =
new
ObservableCollection<ResourceType>();
ParseXML();
Appointment test =
new
Appointment { Start = DateTime.Now, End = DateTime.Today.AddHours(2), Subject =
"Appointment"
};
ResourceType kanal =
new
ResourceType(
"Kanal"
);
for
(
int
i = 0; i < KanalList.Count; i++)
{
Resource imekanala =
new
Resource(KanalList[i]);
kanal.Resources.Add(imekanala);
}
result.Add(kanal);
return
result;
}
public
MyViewModel()
{
ResourcesTypes = GenerateResourceTypes();
Appointments =
new
ObservableCollection<Appointment>();
}
Don't know how to add appointment in ResourcesTypes ??
0
Accepted
Hello Vanja,
You just need to add the resource to Resources property of the appointment:
Also note the you should group the RadScheduleView by "Kanal" resource type in order to display the appointment:
Hope this helps.
All the best,
Yana
the Telerik team
You just need to add the resource to Resources property of the appointment:
Appointment test =
new
Appointment {
Start = DateTime.Now,
End = DateTime.Today.AddHours(2),
Subject =
"Appointment"
};
test.Resources.Add(
new
Resource(
"Kanal1"
,
"Kanal"
));
Also note the you should group the RadScheduleView by "Kanal" resource type in order to display the appointment:
<
telerik:RadScheduleView
x:Name
=
"ScheduleView"
AppointmentsSource
=
"{Binding Appointments}"
ResourcesSource
=
"{Binding ResourcesTypes}"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:MonthViewDefinition
/>
<
telerik:WeekViewDefinition
/>
</
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:RadScheduleView.GroupDescriptionsSource
>
<
telerik:GroupDescriptionCollection
>
<
telerik:DateGroupDescription
/>
<
telerik:ResourceGroupDescription
ResourceType
=
"Kanal"
/>
</
telerik:GroupDescriptionCollection
>
</
telerik:RadScheduleView.GroupDescriptionsSource
>
</
telerik:RadScheduleView
>
Hope this helps.
All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items