Help with height of a RadMenu

2 posts, 0 answers
  1. Karol
    Karol avatar
    4 posts
    Member since:
    Jul 2011

    Posted 23 Apr 2013 Link to this post

    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
  2. Karol
    Karol avatar
    4 posts
    Member since:
    Jul 2011

    Posted 23 Apr 2013 Link to this post

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