Scrollbar in Radpanelbar item

9 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
    3299 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. 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.

  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3299 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.

  5. Arpit
    Arpit avatar
    10 posts
    Member since:
    Dec 2017

    Posted 11 Dec 2017 in reply to Tina Stancheva Link to this post

    Hi , I have unzip the code but the files are blank, Could you please help me?
  6. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    686 posts

    Posted 14 Dec 2017 Link to this post

    Hello,

    I downloaded the project and the files are OK on my side. May I ask you for some additional information in order to assist you? Which program are you using to unzip the archive? Also what program are you trying to open the files with?

    I am looking forward to your answer.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  7. Eran
    Eran avatar
    2 posts
    Member since:
    Feb 2018

    Posted 24 Mar 2018 in reply to Vladimir Stoyanov Link to this post

    i have ObservableCollection<Job> which RadPanelBar is bound to.

    when i try to implement your solution i can't fins the way to convert from Job type to RadPanelBarItem and to set MaxHeigh.

    can you please suggest how should i do that?

     

    thanks in advance,

  8. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    686 posts

    Posted 27 Mar 2018 Link to this post

    Hello Eran,

    Since when binding the ItemsSource of the RadPanelBar to custom objects, those objects are wrapped in RadPanelBarItems before being pushed in the Items collection of the RadPanelBar, you can still access them though the ContainerFromItem method of the ItemContainerGenerator. That would look something like this:
    var panelBarItem = myPanel.ItemContainerGenerator.ContainerFromItem(myPanel.Items[0]);

    Please note that in the above snippet "myPanel" refers to the RadPanelBar instance that you are targeting.

    Hope this helps.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  9. Eran
    Eran avatar
    2 posts
    Member since:
    Feb 2018

    Posted 28 Mar 2018 Link to this post

    That was very helpful, thanks a lot.

Back to Top