Scrollbar in Radpanelbar item

4 posts, 0 answers
  1. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 19 Mar 2013 Link to this post

    Hi There,
    I have a requirement to display vertical and horizontal scroll bars in RadPanelbar item when its content is large, but Radpanel bar doesnt support this, instead it stretches vertically/horizontally as much as we have the content,  and the last radpanelbar item will hide at the bottom of the Radpanelbar. 
    Please verify the screenshot for more information(what we are expecting is depicted in the screenshot).

    Regards,
    Srinivas.
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 20 Mar 2013 Link to this post

    Hi Srinivas,

    This issue is caused by the RadPanelBar default template which wraps the ItemsPresenter (representing the PanelBarItems) in a ScrollViewer control. This is why in order to get over this behavior, you  will have to edit the default ControlTemplate of the control to remove the ScrollViewer.

    I attached a sample solution demonstrating this approach so please have a look at it and let me know if it helps.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 21 Mar 2013 Link to this post

    Hi Tina Stancheva ,

    When we set IsExpand="true" to all PanelBarItems then we dont see the Panels which are at the bottom of the RadPanelbar. is there any way that i can control the scrollviewer in both cases (for PanelBar and PanelBarItem)

    Regards,
    Srinivas.

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 26 Mar 2013 Link to this post

    Hi Srinivas,

    Thank you for getting back to us. Unfortunately the RadPanelBar control doesn't support such a behavior out-of-the-box. However, you can customize the RadPanelBarItems resizing logic handling the Expanded and Collapsed events in order to implement your customizations.

    For example you can calculate the MaxHeight of each item based on the ActualHeight of the RadPanelBar and the default ActualHeight of the collapsed PanelBarItem which by default is about 22px. Using this approach I prepared a sample project which customizes the RadPanelBarItem's MaxHeight property based on the count of all items and the ActualHeight of the PanelBar control at a given moment.

    Please note that in the attached solution, the RadPanelBar default style isn't changed, which means that it still contains a ScrollViewer but I have disabled the scroll bars. Let me know if this helps.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top