Scrollbars with Panel

4 posts, 0 answers
  1. Maciej
    Maciej avatar
    8 posts
    Member since:
    Nov 2015

    Posted 04 Nov Link to this post

    Hi,

    I have a little problem. I put RadPanel in application based on Visual Studio theme with the following code.

        <StackPanel x:Name="NavigationStackPanel">
            <telerik:RadPanelBar
                x:Name="NavigationPanel"
                AutoScrollToSelectedItem="True"
                BringIntoViewMode="HeaderAndItems"
                ExpandMode="Multiple" SelectionMode="Single"
                ItemsSource="{Binding Path=ApplicationNodes}"
                ItemTemplate="{StaticResource PanelBarHeaderTemplate}"
                SelectionChanged="NavigationPanel_SelectionChanged"
                BorderThickness="0"
                ScrollViewer.HorizontalScrollBarVisibility="Visible"
                ScrollViewer.VerticalScrollBarVisibility="Visible" />
        </StackPanel>

     

    Unfortunately, scroll does not work properly as you can see on the screenshots. Any ideas how I can fix it?

  2. Milena
    Admin
    Milena avatar
    204 posts

    Posted 08 Nov Link to this post

    Hi Maciej,

    Thank you for the code-snippet and pictures provided. 

    I saw that you have set AutoScrollToSelectedItem property to true. It is available because RadPanelBar class inherits the RadTreeView, but this functionality is implemented in the treeview only. However, you can achieve such behavior by using Expanded event of RadPanelBar and brings into view the last expanded PanelBarItem. For your convenience I implement this approach in the attached project. Please take a look at it and let me know if this works for you. 

    Regards,
    Milena
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Maciej
    Maciej avatar
    8 posts
    Member since:
    Nov 2015

    Posted 09 Nov in reply to Milena Link to this post

    Hi Milena,

    Thank you for your help and little project.

    To be honest, it does not solve my problem. To show better what I meant, I added a red border. What I was trying to achive is to have scrollbars when not all control content is visible line on screenshot no. 2

    Have a nice day,

    Best regards,

    Maciek

  5. Milena
    Admin
    Milena avatar
    204 posts

    Posted 11 Nov Link to this post

    Hello Maciej,

    In order to enable scrolling logic you need to set Width and Height of the control. The ScrollViewer enables content to be displayed in a smaller area than its actual size. If you don't restrict the size of the panelbar, it will get all the needed space to show its content. 

    I hope this time we are on the same page. If not and I misunderstand your question, please provide us a sample project and detailed information about your requirements and expected behavior. This will allow us to examine your implementation so that we could suggest a suitable approach. 

    I'm looking forward to your reply.

    Regards,
    Milena
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top