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

Vertical orientation of Header Text

2 Answers 99 Views
Expander
This is a migrated thread and some comments may be shown as answers.
schneeflocke
Top achievements
Rank 1
schneeflocke asked on 03 Feb 2013, 08:50 PM
Hi,

using Sample http://demos.telerik.com/silverlight/#Expander/FirstLook
If you choose left or right as expand direction the Header text of the expander is orientated in a vertical way.

How can I do the same?

The sample coding just use:

<telerik:RadExpander.Header>
    <TextBlock x:Name="expanderCaption" Text="Header" />
</telerik:RadExpander.Header>

Thanks

Stefan

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 06 Feb 2013, 02:29 PM
Hi,

If you take a closer look at the demonstration project and open the Example.xaml.cs file you will find the following code:

private void OnDirectionsClick(object sender, RoutedEventArgs e)
{
    System.Windows.Controls.RadioButton radioButton = e.OriginalSource as System.Windows.Controls.RadioButton;
    if(radioButton != null)
    {
        Telerik.Windows.Controls.ExpandDirection expandDirection = (Telerik.Windows.Controls.ExpandDirection)System.Enum.Parse(typeof(Telerik.Windows.Controls.ExpandDirection), radioButton.Content.ToString(), true);
        this.radExpander.ExpandDirection = expandDirection;
 
        switch (expandDirection)
        {
            case Telerik.Windows.Controls.ExpandDirection.Down:
                this.radExpander.VerticalContentAlignment = System.Windows.VerticalAlignment.Top;
                this.radExpander.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                break;
            case Telerik.Windows.Controls.ExpandDirection.Left:
                this.radExpander.VerticalContentAlignment = System.Windows.VerticalAlignment.Stretch;
                this.radExpander.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
                break;
            case Telerik.Windows.Controls.ExpandDirection.Right:
                this.radExpander.VerticalContentAlignment = System.Windows.VerticalAlignment.Stretch;
                this.radExpander.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                break;
            case Telerik.Windows.Controls.ExpandDirection.Up:
                this.radExpander.VerticalContentAlignment = System.Windows.VerticalAlignment.Bottom;
                this.radExpander.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                break;
            default:
                break;
        }
    }
}

This is the implementation of the Click event handler of all radio buttons in the ConfigurationPanel. And this code is used to rotate the header. Basically we set the ExpandDirection property of the RadExpander control and the control internally handles the rotation of the header.

Kind regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
schneeflocke
Top achievements
Rank 1
answered on 06 Feb 2013, 03:34 PM
Thanks for your help. I missed the yellow marked line of code.

Thanks

Stefan
Tags
Expander
Asked by
schneeflocke
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
schneeflocke
Top achievements
Rank 1
Share this question
or