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

Help with height of a RadMenu

1 Answer 130 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Karol
Top achievements
Rank 1
Karol asked on 23 Apr 2013, 03:49 PM
Hello Telerik Team,
I have the following code:

<Window x:Class="RadMenu0.Testing.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="24*" />
            <RowDefinition Height="287*" />
        </Grid.RowDefinitions>
        <telerik:RadMenu VerticalAlignment="Top">
            <telerik:RadMenuItem Header="Item 1">
                <telerik:RadMenuItem Header="Sub Item 1" />               
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Header="Item 2">
                <telerik:RadMenuItem Header="Sub Item 1" />               
            </telerik:RadMenuItem>
        </telerik:RadMenu>
        <telerik:RadDocking HasDocumentHost="True" Grid.Row="1">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup  HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <telerik:RadPane Header="Pane 1">
                            <TextBlock>Hello</TextBlock>
                        </telerik:RadPane>
                        <telerik:RadPane Header="Pane 2" />
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>
    </Grid>
</Window>


When I run and maximize the window, the RadMenu gets proportionaly bigger (naturally, as a star notation is used).
Now I could use a fixed height for the first grid row - but I am not sure that it is a good practice - I am just learning wpf and most of the starting materials discourage from using fixed sizes in wpf.

Could you please tell me what would be a good/standard way of making the RadMenu occupy just enough space to draw its contents and keep same height even when resizing? In other words, I am trying to add a menu just like in other standard windows desktop applications.

However, if a fixed size must be used, what would be the minimum height for the RadMenu?

Thank you in advance for you reply.

Best Regards,
Karol

1 Answer, 1 is accepted

Sort by
0
Karol
Top achievements
Rank 1
answered on 23 Apr 2013, 04:13 PM
Hello Telerik Team,
I quickly realized the mistake I was doing in the previous post.

Setting the Height properties on the rows like this solved my problem:
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />

Please consider my question closed. If there is anything I need to do to mark this question as resolved, please let me know.

Best Regards,
Karol
Tags
Menu
Asked by
Karol
Top achievements
Rank 1
Answers by
Karol
Top achievements
Rank 1
Share this question
or