This is a migrated thread and some comments may be shown as answers.

Resources ItemsControl

2 Answers 112 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Karl
Top achievements
Rank 1
Karl asked on 27 Aug 2012, 01:00 PM
Hello,

we got an ObservableCollection of custom appointments with resources, which we would like to edit "outside" the RadScheduleView component in a seperate RadWindow containing a RadDataForm.
For editing the resources we tried to use the ItemsControl "PART_Resources" as shown in the "Custom Appointment and Validation" sample. Unfortunately we did not manage to get the ItemsControl to work properly: The comboboxes are not shown and instead of them
we got some lines showing "Telerik.Windows.Controls.ResourceType" (the number of lines corresponds to the number of resourcetypes we are using).

Is it even possible to use the ItemsControl in that way (If yes, what are the requirement to get it running)?
Is there a different / recommended approach to implement the above task?

Thanks in advance!

Kind regards,

Karl

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladi
Telerik team
answered on 05 Sep 2012, 01:49 PM
Hello Karl,

When the EditAppointmentDialog displays the resources in its ItemsControl it expects that the passed item is of type ResourceTypeViewModel but in the scenario when accessing the resources from outside the control the item in the ItemsControl is of type ResourceType. All that is needed is to create a custom ResourceTypeTemplateSelector that inherits DataTemplateSelector and override its SelectTemplate method. Next you will need to make sure the bindings are correct.

We created a sample project that represents the described approach with one ItemsControl and a ScheduleView with two resources. Give it a try.

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Karl
Top achievements
Rank 1
answered on 06 Sep 2012, 02:15 PM
Hello Vladi,

thanks for your help - works like a charm now.
You definitely saved my day!

Best regards,

Karl


Tags
ScheduleView
Asked by
Karl
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Karl
Top achievements
Rank 1
Share this question
or