Width of content in RadPanelBarItem

4 posts, 0 answers
  1. Simon
    Simon avatar
    1 posts
    Member since:
    Feb 2012

    Posted 19 Dec 2012 Link to this post


    I have a RadGridView inside a RadPanelBarItem, the grid has lots of columns so doesn't fit horizontally in the PanelBarItem.  By default the RadPanelBarItem expands to accommodate the gird however I'd like the grid to respect the width of its parent RadPanelBarItem.

    <telerik:RadPanelBar>
        <telerik:RadPanelBarItem IsExpanded="True">
            <telerik:RadPanelBarItem.Header>
                <TextBlock Text="Grid"/>
            </telerik:RadPanelBarItem.Header>
            <telerik:RadGridView >
                <telerik:RadGridView.Columns>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                    <telerik:GridViewColumn Header="Header">
                    </telerik:GridViewColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </telerik:RadPanelBarItem>
    </telerik:RadPanelBar>

    I have tried binding the width of the RadGridView to the ActualWidth of the RadPanelBar which gets close but is off by a few pixels due to the margin around the RadPanelBarItem content.  I'd prefer a solution which doesn't involve binding the width of the grid.
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 21 Dec 2012 Link to this post

    Hello Simon,

    I am not sure that I understand your scenario. Is it possible for you to send us your project so we can better understand it and suggest the best approach in your case?

    Thank you for your cooperation.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oddvin Kaafjord
    Oddvin Kaafjord avatar
    1 posts
    Member since:
    Feb 2013

    Posted 08 Mar 2013 Link to this post

    Hi

    I'm experiencing the same problem. When resizing(maximizing) the application the content of the RadPanelBar resizes accordingly, but when I try to decrease the size of the application window the content of the RadPanelBar does not resize, keeps the maximized size.

    Also using the RadTimeBar component inside the RadPanelBar causese it to not display intervals.

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 12 Mar 2013 Link to this post

    Hello Oddvin,

    The RadPanelBar ControlTemplate defines a ScrollViewer that wraps the Items of the PanelBar so you can remove it to allow the content of the PanelBarItems to use their own measuring mechanism to work. This will allow the RadTimeBar component to display its built-in ScrollViewer and it will reflect the actual size of the bar.

    Please give this a try and let me know it it helps.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top