Header for Left/Right Expand

4 posts, 0 answers
  1. Andy
    Andy avatar
    4 posts
    Member since:
    Aug 2008

    Posted 03 Sep 2008 Link to this post

    I am trying to orient the content of the Header (just text) to be rotated 90 or -90 depending on the ExpandDirection.

    I have created a DataTemplate with a Grid containing a TextBlock.

    The Grid uses RotateTransform to draw itself vertically.

    The text draws correctly but I am having trouble getting the header to re-size correctly.  It seems to size itself based on the initial width of the textblock's text and not the height of the text after the textbox is rotated.

    Here is the code for the HeaderTemplate
    <Grid Background="#FF292C29" RenderTransformOrigin="0.5,0.5">
        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"            TextWrapping="Wrap" FontSize="12" Foreground="#FFF7F3F7" Text="Activities" />
             <RotateTransform Angle="90"></RotateTransform>

    I would like the grid to expand and have the same height as the RadExpander object, yet only be as wide as the text's size plus margin.

    Any suggestions?

    Thanks for your time
  2. Valentin.Stoychev
    Valentin.Stoychev avatar
    2198 posts

    Posted 04 Sep 2008 Link to this post

    Hi Andy,

    The problem here is that when you use the RenderTransform the new size is not part of the layout calculations.

    Can't you use fixed size for the container Grid element ( set the Width and Height properties)?

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Chiara
    Chiara avatar
    31 posts
    Member since:
    Oct 2011

    Posted 24 Oct 2011 Link to this post

    Hi Valentin, 
    I have a problem with the expander's style.
    I have changed the default style of windows7 radexpander, but now I want to create three more:
    one expander on the right, one on the left and one at the bottom.

    If I change the RenderTrasform property on the ContentPresenter, it also change the expander's content (not only the togglebutton).
    How to rotate only the togglebutton and the expander's animation?

    Is it possible?
    Thank you very much

    Here you can find my example: Expander Style

  4. Petar Mladenov
    Petar Mladenov avatar
    2991 posts

    Posted 27 Oct 2011 Link to this post

    Hello Chiara,

     We used LayoutTransformControl in order to achieve the Rotations you needed:

    <!-- add LayoutTransformControl -->
    <telerikPrimitives:LayoutTransformControl RenderTransformOrigin=".5 .5"
            x:Name="HeaderContentButton" >
        <Grid x:Name="HeaderPanel" Background="Transparent">
    Please examine the modified solution and let us know if it satisfies you. Regards,
    Petar Mladenov
    the Telerik team

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

Back to Top