Changing RadListBox ScrollViewer Height and Width

3 posts, 0 answers
  1. Paweł
    Paweł avatar
    46 posts
    Member since:
    May 2013

    Posted 16 Oct 2013 Link to this post

    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. Masha
    Admin
    Masha avatar
    355 posts

    Posted 21 Oct 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Paweł
    Paweł avatar
    46 posts
    Member since:
    May 2013

    Posted 21 Oct 2013 Link to this post

    Thanks, that's what I needed - work's great.
Back to Top