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

RadListBox vertical scroll bar

4 Answers 1341 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Davide
Top achievements
Rank 1
Davide asked on 26 Jul 2012, 09:31 AM
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?

4 Answers, 1 is accepted

Sort by
0
Davide
Top achievements
Rank 1
answered on 26 Jul 2012, 09:41 AM
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?
0
Davide
Top achievements
Rank 1
answered on 26 Jul 2012, 10:03 AM
No one can help me?
1
Davide
Top achievements
Rank 1
answered on 26 Jul 2012, 03:38 PM
Solved: I had to put the RadListBox in a Grid.
0
Lance B
Top achievements
Rank 2
answered on 28 Jan 2015, 12:36 PM
Thanks Davide

Your Post helped me

Lance
Tags
ListBox
Asked by
Davide
Top achievements
Rank 1
Answers by
Davide
Top achievements
Rank 1
Lance B
Top achievements
Rank 2
Share this question
or