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

Changing RadListBox ScrollViewer Height and Width

2 Answers 355 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Paweł
Top achievements
Rank 1
Paweł asked on 16 Oct 2013, 11:25 AM
Hello, Im using this code:
<telerik:RadListBox Name="testlv" SelectionChanged="testlv_SelectionChanged" telerik:StyleManager.Theme="Windows8Touch">
                <telerik:RadListBox.Resources>
                    <Style TargetType="ScrollBar">
                        <Setter Property="telerik:StyleManager.Theme" Value="Windows8Touch" />
                        <Setter Property="MinWidth" Value="40" />
                        <Setter Property="MinHeight" Value="40" />
                    </Style>
                </telerik:RadListBox.Resources>
                <telerik:RadListBox.ItemTemplate>
                    <DataTemplate>
                        <Border BorderBrush="Turquoise" BorderThickness="0,0,0,1" Width="{Binding Path=ActualWidth, ElementName=grdzero}">
                            <WrapPanel Orientation="Vertical" >
                                <TextBlock Foreground="Black" Text="{Binding nazwa}" FontSize="16"></TextBlock>
                                <WrapPanel Orientation="Horizontal">
                                    <TextBlock Foreground="Black" Text="Cena: "  FontSize="16"></TextBlock>
                                    <TextBlock Foreground="Black" Text="{Binding cena}"  FontSize="16"></TextBlock>
                                </WrapPanel>
                                <WrapPanel Orientation="Horizontal">
                                    <TextBlock Foreground="Black" Text="Kod: "  FontSize="16"></TextBlock>
                                    <TextBlock Foreground="Black" Text="{Binding kod}"  FontSize="16"></TextBlock>
                                </WrapPanel>
                            </WrapPanel>
                        </Border>
                    </DataTemplate>
                </telerik:RadListBox.ItemTemplate>
            </telerik:RadListBox>

And I'd like to change width and height of scrollbar to value equal 40. How can I do it? (At this momment scrollbars are too small and cant be really touch by finger and scroll down).

Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 21 Oct 2013, 08:10 AM
Hello Pawel,

You need to modify the control template of ScrollViewer style in order to modify the ScrollBar sizes. Look for Scrollbars named PART_VerticalScrollBar and PART_HorizontalScrollBar inside it and apply the desired size on them. The approach is demonstrated in the attached project.

I hope it helps.

Regards,
Masha
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Paweł
Top achievements
Rank 1
answered on 21 Oct 2013, 10:26 AM
Thanks, that's what I needed - work's great.
Tags
ListBox
Asked by
Paweł
Top achievements
Rank 1
Answers by
Masha
Telerik team
Paweł
Top achievements
Rank 1
Share this question
or