This is a migrated thread and some comments may be shown as answers.

Scrollbars with Panel

3 Answers 287 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Maciej
Top achievements
Rank 1
Maciej asked on 04 Nov 2016, 10:13 AM

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?

3 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 08 Nov 2016, 11:40 AM
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!
0
Maciej
Top achievements
Rank 1
answered on 09 Nov 2016, 09:51 AM

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

0
Milena
Telerik team
answered on 11 Nov 2016, 08:36 AM
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!
Tags
PanelBar
Asked by
Maciej
Top achievements
Rank 1
Answers by
Milena
Telerik team
Maciej
Top achievements
Rank 1
Share this question
or