Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > Header for Left/Right Expand

Not answered Header for Left/Right Expand

Feed from this thread
  • Andy avatar

    Posted on Sep 3, 2008 (permalink)

    Hello,
    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" />
       <Grid.RenderTransform>
             <RotateTransform Angle="90"></RotateTransform>
       </Grid.RenderTransform>
    </Grid>

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

    Reply

  • Valentin.Stoychev Valentin.Stoychev admin's avatar

    Posted on Sep 4, 2008 (permalink)

    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,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Chiara avatar

    Posted on Oct 24, 2011 (permalink)

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

    Here you can find my example: Expander Style


    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Oct 27, 2011 (permalink)

    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">
            <Grid.RowDefinitions>
    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 >>

    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > Header for Left/Right Expand
Related resources for "Header for Left/Right Expand"

Silverlight Expander Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]