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

Group Header not displayed

5 Answers 102 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
G. Neumann
Top achievements
Rank 1
G. Neumann asked on 27 Jan 2011, 04:51 PM
Hi,
starting on porting our code from Scheduler to ScheduleView, i got some problems. So I decided to start with a very small test application that is based on your startup code. This code uses
* 3 collections for the scheduleview ( ResourceTypesSource, GroupDescriptionsSource, AppointmentsSource)
* functions to create some test data
* a Viewmodel to bind the data, and setting the ScheduleView DataContext to the ViewModel.
Perhaps there is a special order ho tow set the DataSources and the DataContext that I'm not aware of. 

My problems:
1. The groups don't have a header. Instead there is displayed an internal class name "Ms.Internal.CollectionViewGroupGeneral"
I must admit that the difference between groups and resourceTypes is not completely clear. I understand it that way that a grouping defines how resources are grouped together. So as the header I would expect the name of the resource displayed for that the appointments are grouped...? At least that is what i want to do :)

2. The appointments seem to be assigned to the correct resource. But when editing an appointment, no resource editing is possible (not like in Scheduler, at least as default). Is there a way to allow the dialog that resource editing is desired?

I would upload the complete code, if the upload functionality would let me do this... At the moment I attached a screenshot of the view and the edit dialog.

5 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 28 Jan 2011, 09:47 PM
I wonder if with Silverlight, we will have the possibility to design a datatemplate for a group header?

Also, did you find a way to show the group displayname??
0
Accepted
Hristo
Telerik team
answered on 01 Feb 2011, 09:59 AM
Hi Neumann,

Direct to your problems:
1. ResourceTypes are the type of resource on which you can group by. And in order to group by some resource you have to add ResourceGroupDescriptor and specify the resource type which will be used for grouping. Please note that if you specify resource group descriptor which groups by resource type that is not in the ResourceTypeSource collection then this group descriptor is not applied at all.
As for the problem that GroupHeaders showing Ms.Internal.CollectionViewGroupGeneral instead of group name - this is bug in the data template for GroupHeader control. We have fixed it and the new build will be available later today

2. I'm unable to reproduce this behavior. I have sample application that group by 2 resources and a date and I'm able to change the resources of the Appointment in the Edit Appointment dialog (e.g. it is like in RadScheduler - you have comboboxes which allow you to select one or more resource depending on the AllowMultipleSelection property on the ResourceType instance.)

In order to attach code you have to open a support ticket.

Hi Mike,

In RadScheduleView you have GroupHeaderContentTemplate, GroupHeaderContentTemplateSelector and GroupHeaderStyleSelector all of type ScheduleView*Selector. This is an extended selector that give you the item, container and ActiveViewDefinition.
Group display name is fixed and will be available with the next build.

Let me know if you need more information.

Greetings,
Hristo
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
kjellerik
Top achievements
Rank 1
answered on 01 Feb 2011, 11:50 AM
I had the same problem with the Resources not displaying, but seems like its has been fixed in the newest version. 

However when i now open an appoitment the selected resource is not chosen in the dropdown list, even tho its value is correct in "SelectedAppointment" object. see attachment

Regards
Kjell Erik Reed Anda
0
G. Neumann
Top achievements
Rank 1
answered on 02 Feb 2011, 04:56 PM
Hi, Hristo,

first at all I want to thank you - both of these 2 problems seem to be solved with the new fixes of version 1331/1401. In the example app
* the resources are displayed with correct resource name,
* The EditAppointmentDialog displays the resources now.

This ist all very well for a simple example app. But for my real-life project that I'm adapting from RadScheduler, I've got a lot of problems. Data binding doesn't work identically, so the resource headers aren't assigned correctly.
I tried to change the Resource assignement in the way to assign a Resource of type Resource directly instead of assigning an inherited object (IResource). It seems that inheriting from an object that implements IResource doesn't work correctly, so that the resource assignment isn't working.
But this doesn't seem to be the whole story. I've got problems to instantiate the ViewModel correctly and bind the collections to the Observable colelctions in the ViewModel. If I bind too early, the resource assignment doesn't work. But this prevents the scheduler control from beeing displayed early (whats what the customers want).
Additionally I had problems to instantiate only one ViewModel. I had been using a ViewModel as collectionViewSource

<CollectionViewSource x:Key="modelViewSource" d:DesignSource="{d:DesignInstance ViewModel:MainPageViewModel, CreateList=True}" />

But after removing all ViewModel instantiation in XAML and creating it only at Runtime, the complete binding isn't working any more: no appointments are displayed, no resource headers are displayed, no resource selection comboboxes are shown in the EditAppointmentDialog. This is mystic and I will continue to find the reason for these problems.

Thank you!
Gerd
0
Hristo
Telerik team
answered on 02 Feb 2011, 10:51 PM
Hi all,

@Kjell
Could you send us sample project demonstrating this issue.

@Neumann
I will not recommend using single CollectionViewSource as a source to multiple RadSchedueViews. Internally if we have ICollectionView as a source collection we will regroup it and this will affect the other schedule views that are using the same CollectionView source. This may be the reason for missing headers.
There shouldn't be any problem using IResoure type. A project or detailed explanation about the problem will help us determine what could cause it.
As for the data binding issues - we did change a little bit the data context of AppointmentItem compared to RadScheduler. This was done for performance improvements (when using the default Appointment class the scrolling performance is better compared with custom IAppointment implementation).
If you are using the default Appointment implementation as a source then you can bind to its properties using this syntaxis:
Subject="{Binding Subject}"
But if you are using custom IAppointment implementation then you should use the following:
Subject="{Binding Appointment.Title}"

If you are unable to resolve this issues, please send us your project and we will be happy to help.

Best wishes,
Hristo
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
ScheduleView
Asked by
G. Neumann
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Hristo
Telerik team
kjellerik
Top achievements
Rank 1
G. Neumann
Top achievements
Rank 1
Share this question
or