Orientation of Resource Text

13 posts, 0 answers
  1. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 26 Oct 2011 Link to this post

    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
  2. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 26 Oct 2011 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Oct 2011 Link to this post

    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 >>

  5. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 26 Oct 2011 Link to this post

    Thanks a LOT for such a prompt response Yana, I'll take a look now.
  6. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 26 Oct 2011 Link to this post

    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.
  7. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 28 Oct 2011 Link to this post

    Hi, this isn't really solved as of yet. I preferably need to steer clear of the style selector.
  8. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 02 Nov 2011 Link to this post

    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 >>

  9. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 03 Nov 2011 Link to this post

    That's perfect!! Thanks a lot mate!
  10. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 03 Nov 2011 Link to this post

    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?
  11. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Nov 2011 Link to this post

    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 >>

  12. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 09 Nov 2011 Link to this post

    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. 
  13. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 09 Nov 2011 Link to this post

    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!?
  14. Daniel
    Daniel avatar
    34 posts
    Member since:
    Oct 2011

    Posted 09 Nov 2011 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready