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

Orientation of Resource Text

12 Answers 234 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 26 Oct 2011, 08:55 AM
Probably a really simple one this, but I've changed the orientation of the day view to horizontal. I would now like to do the same with the resource (grouping) text. Each row is rather high, I'd like the text to read horizontally instead.

Thanks,

Dan

12 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 26 Oct 2011, 08:57 AM
And the day text too I should add.

NOTE: I really want to avoid using a group header template if that's possible - it causes problems with my custom drag drop behaviour.
0
Yana
Telerik team
answered on 26 Oct 2011, 09:03 AM
Hello Dan,

You should use GroupHeaderStyleSelector in order to change the orientation of the resources headers. Please check this help article for a detailed explanation.

Greetings,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Daniel
Top achievements
Rank 1
answered on 26 Oct 2011, 09:08 AM
Thanks a LOT for such a prompt response Yana, I'll take a look now.
0
Daniel
Top achievements
Rank 1
answered on 26 Oct 2011, 09:11 AM
Just to be clear Yana, I only meant the orientation of the text you know. As it stands, the day view is orientated horizontally, so the timeline is at the top, and the grouping is done to the left (vertically), but the text is also vertical, I just want that to read horizontally.
0
Daniel
Top achievements
Rank 1
answered on 28 Oct 2011, 10:19 AM
Hi, this isn't really solved as of yet. I preferably need to steer clear of the style selector.
0
Yana
Telerik team
answered on 02 Nov 2011, 10:19 AM
Hi Daniel,

I am sorry for my misunderstanding,  actually the text orientation is set in the GroupHeaders templates, that's why you should create a custom GroupHeaderContentTemplateSelector.

I've attached a simple project to demonstrate the exact approach, please download it and give it a try.

Greetings,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Daniel
Top achievements
Rank 1
answered on 03 Nov 2011, 03:42 PM
That's perfect!! Thanks a lot mate!
0
Daniel
Top achievements
Rank 1
answered on 03 Nov 2011, 05:47 PM
Sorry to bother you with this again Yana, but is it possible you can tell me how to hide the date please? So that the template you've designed for me does not include the date but just the resource name?
0
Yana
Telerik team
answered on 04 Nov 2011, 12:37 PM
Hi Daniel,

Actually there is a different template for the date, check the SelectTemplate method:

public override DataTemplate SelectTemplate(object item, DependencyObject container, ViewDefinitionBase activeViewDeifinition)
{
    CollectionViewGroup cvg = item as CollectionViewGroup;
    if (cvg != null && cvg.Name is IResource)
    {
        return this.HorizontalResourceTemplate;
    }
 
    if (cvg != null && cvg.Name is DateTime)
    {
        if (activeViewDeifinition.GetOrientation() == Orientation.Vertical)
        {
            return this.HorizontalTemplate;
        }
        else
        {
            return this.VerticalTemplate;
        }
    }
    return base.SelectTemplate(item, container, activeViewDeifinition);
}

when the GroupHeader is for a Resource, the method returns HorizontalResourceTemplate, when it's for a Date - returns different templates for horizontal and vertical orientation: VerticalTemplate and HorizontalTemplate. You can modify the templates in the XAML without a problem.


Best wishes,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Daniel
Top achievements
Rank 1
answered on 09 Nov 2011, 09:58 AM
Hi Yana,

I'm a bit confused because in the sample project you kindly provided I have the following xaml for the "VerticalTemplate":

			<local:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
				<DataTemplate>
					<telerik:LayoutTransformControl>
						<telerik:LayoutTransformControl.LayoutTransform>
							<RotateTransform Angle="-90" />
						</telerik:LayoutTransformControl.LayoutTransform>
						<TextBlock Margin="4" Text="{Binding Name, StringFormat=dd dddd}" VerticalAlignment="Top" />
					</telerik:LayoutTransformControl>
				</DataTemplate>
			</local:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>

I can't see any code that accounts for the date and time part of the header. 
0
Daniel
Top achievements
Rank 1
answered on 09 Nov 2011, 10:06 AM
To cause me further confusion, I've just deleted the template selector so it's now only this:

		<local:CustomGroupHeaderContentTemplateSelector x:Key="CustomGroupHeaderContentTemplateSelector">
		</local:CustomGroupHeaderContentTemplateSelector>	

And I'm getting the exact same results!?
0
Daniel
Top achievements
Rank 1
answered on 09 Nov 2011, 03:19 PM
This is unbelievably buggy.

I'm trying to filter resources aswell, and the date and resource name (Employee 1 etc.) have started swapping place on certain rows!?

EDIT: Forget it, I've sorted it, the template I was after is called 
VerticalDayViewDateTemplate
Thanks anyway.
Tags
ScheduleView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Yana
Telerik team
Share this question
or