Custom OrientedGroupHeaderContentTemplateSelector

2 posts, 0 answers
  1. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 27 Jun 2011 Link to this post

    Hi,
    I have created a custom OrientedGroupHeaderContentTemplateSelector (code pasted below).
    But when I run it, the control is displayed for a second and then crashes with the error:
    Layout cycle detected, layout could not complete. I tried to comment out all templates inside it, with the same result.

    Strangely it worked for me last week.
    Any ideas?

    Regards,
    Håkan

    <telerik:OrientedGroupHeaderContentTemplateSelector x:Key="CustomGroupHeaderContentTemplateSelector">
              <telerik:OrientedGroupHeaderContentTemplateSelector.VerticalMonthViewDateTemplate>
                  <DataTemplate>
                      <telerik:LayoutTransformControl>
                          <telerik:LayoutTransformControl.LayoutTransform>
                              <RotateTransform Angle="-90" />
                          </telerik:LayoutTransformControl.LayoutTransform>
                          <TextBlock Margin="2" Text="{Binding Name, StringFormat=MMMM}" VerticalAlignment="Center" />
                      </telerik:LayoutTransformControl>
                  </DataTemplate>
              </telerik:OrientedGroupHeaderContentTemplateSelector.VerticalMonthViewDateTemplate>
              <telerik:OrientedGroupHeaderContentTemplateSelector.VerticalDayViewDateTemplate>
                  <DataTemplate>
                      <telerik:LayoutTransformControl>
                          <telerik:LayoutTransformControl.LayoutTransform>
                              <RotateTransform Angle="-90" />
                          </telerik:LayoutTransformControl.LayoutTransform>
                          <TextBlock Margin="2" Text="{Binding Name, StringFormat='dddd'}" />
                      </telerik:LayoutTransformControl>
                  </DataTemplate>
              </telerik:OrientedGroupHeaderContentTemplateSelector.VerticalDayViewDateTemplate>
              <telerik:OrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
                  <DataTemplate>
                      <TextBlock Text="{Binding Name}" Width="150" TextAlignment="Center" TextWrapping="Wrap" />
                  </DataTemplate>
              </telerik:OrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
          </telerik:OrientedGroupHeaderContentTemplateSelector>

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 30 Jun 2011 Link to this post

    Hi Håkan,

    I guess that you've upgraded to Q2 Beta or an internal build, is this the case?  We've made some changes to GroupHeaderContentTemplateSelector recently, please check this online demo which demonstrates the needed approach.

    Basically you should create your custom OrientedGroupHeaderContentTemplateSelector class which inherits ScheduleViewDataTemplateSelector and override its SelectTemplate method.

    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
  3. DevCraft banner
Back to Top