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

Themed ListBox and scrollbars

5 Answers 226 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 27 May 2011, 10:13 PM
I'm applying the Windows7 theme to the standard listbox so that it's appearance blends in with the rest of my application, but I'm finding something super annoying. I can't get rid of the vertical scrollbar. I've tried setting the scrollviewer properties, but the don't make any difference. No matter how many items I have in my listbox, it shows the scrollbars. When I don't apply the theme, it only shows the scrollbar when the # of items is greater than the height of the box.

How do I get that auto visibility back?

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 28 May 2011, 07:37 AM
Hello Rayne,

 
I have applied the Windows7 theme to the LIstBox control and the vertical scroll bar is showing as expected.
May you please check the attached project and let me know how it differs from yours?


Greetings,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rayne
Top achievements
Rank 1
answered on 31 May 2011, 02:06 PM
Even in the sample, I still see the scrollbars, they are just disabled. If I change the theme to Office_Black, they do as expected...I only get vertical scrollbars when there are more items in the list than the height of the box.

I can't see where to attach screenshots to show what I'm talking about.
0
Rayne
Top achievements
Rank 1
answered on 31 May 2011, 02:11 PM
The expression dark theme does the same thing. The scrollbar is always there, no matter how many items there are in the list. Vista, the office themes and summer work the same way as an unstyled listbox.
0
Accepted
Vanya Pavlova
Telerik team
answered on 01 Jun 2011, 07:31 AM
Hello Rayne,

 
In such case you may create an implict style targeted at ScrollViewer and directly set the theme from there and the visibility of the vertical scrollbars, as shown below:

<Style TargetType="ScrollViewer">
        <Setter Property="telerik:StyleManager.Theme" Value="Windows7"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    </Style>
    </Window.Resources>
     
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <ListBox Margin="136,64,216,82" telerik:StyleManager.Theme="Windows7" ItemsSource="{Binding Collection}"/>
    </Grid>

All the best,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rayne
Top achievements
Rank 1
answered on 01 Jun 2011, 01:23 PM
Thank you! That worked.
Tags
General Discussions
Asked by
Rayne
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Rayne
Top achievements
Rank 1
Share this question
or