RadListBox vertical scroll bar

5 posts, 0 answers
  1. Davide
    Davide avatar
    10 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post

    Hi,
    I'm using this code in XAML:

    <telerik:RadListBox Margin="5" DisplayMemberPath="Description" Name="lstResults" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True">

    This ListBox is filled at runtime after pressing a search button.
    The vertical scrollbar never shows.
    In the search button event, after setting the ItemsSource property, I also put

    ScrollViewer.SetVerticalScrollBarVisibility(Me.lstResults, ScrollBarVisibility.Visible)

    with no success.

    Can you help me?
  2. Davide
    Davide avatar
    10 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post

    I didn't mention that the ListBox is contained in a StackPanel
    <StackPanel Name="pnlFound" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Orientation="Vertical">
        <telerik:RadButton Margin="5" Style="{StaticResource ResourceKey=NewButton}" HorizontalAlignment="Left" />
        <telerik:RadListBox Margin="5" DisplayMemberPath="Description" Name="lstResults" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True">
        </telerik:RadListBox>
    </StackPanel>

    If the ListBox has Height set to "Auto", the vertical scrollbar never appears. If I set Height to a value, scrollbar appears.

    Suggestions?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Davide
    Davide avatar
    10 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post

    No one can help me?
  5. Davide
    Davide avatar
    10 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post

    Solved: I had to put the RadListBox in a Grid.
  6. Lance Benger
    Lance Benger avatar
    2 posts
    Member since:
    Oct 2012

    Posted 28 Jan 2015 Link to this post

    Thanks Davide

    Your Post helped me

    Lance
Back to Top
UI for WPF is Visual Studio 2017 Ready