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

GroupHeaderContentTemplate not applied correctly

3 Answers 136 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Troy
Top achievements
Rank 1
Troy asked on 18 May 2011, 03:43 PM

This is a strange one. I am loading appointments dynamically for multiple resources via a button on the page. I can click the button over and over and everything loads fine. However, if I add a GroupHeaderContentTemplate something weird happens. This first time everything loads fine again. On subsequent loads the data appears to in the correct place however the group headers all appear to be shifted with the first one missing and last one duplicated. I’ve attached some screenshots demonstrating this behavior.

Here is the very basic template I am using.

<telerik:RadScheduleView.GroupHeaderContentTemplate>

    <DataTemplate>

        <TextBlock Text="{Binding Path=.}" ToolTipService.ToolTip="{Binding Path=.}" Width="100" />

    </DataTemplate>

</telerik:RadScheduleView.GroupHeaderContentTemplate>

3 Answers, 1 is accepted

Sort by
0
Oscar Wahlen
Top achievements
Rank 1
answered on 19 May 2011, 08:16 AM
Troy,

I have reported the same problem here:

http://www.telerik.com/community/forums/silverlight/scheduleview/group-header-template-problem.aspx

It has to do with the fact that the data template is not reapplied until after you change the view definition.
0
Troy
Top achievements
Rank 1
answered on 20 May 2011, 05:40 PM
Thanks Oscar. I changed the template to use the "Name" property instead, as you stated you had done, and the issue has been solved.
0
Accepted
Hristo
Telerik team
answered on 24 May 2011, 09:02 AM
Hi guys,

The problem is not that DataTemplate is not reapplied - it is. The problem is that we use proxy object as DataContext for GroupHeader control (like in AppointmentItem and AppointmentItemProxy). Bind to DataContext is a problem because the context is always the same proxy object. That is why you should bind to the correct property (which is updated when new group is set as context of group header control). Otherwise you will not receive PropertyChanged notification and GroupHeader will show its last value.

GroupHeaderProxy properties are:
public object Name
public bool IsBottomLevel
public int ItemCount
public ReadOnlyObservableCollection<object> Items
public string FormattedName

I hope that this will help you.

Best wishes,
Hristo
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
Tags
ScheduleView
Asked by
Troy
Top achievements
Rank 1
Answers by
Oscar Wahlen
Top achievements
Rank 1
Troy
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or