Anyone know why I can’t scroll my ListBox with Grid?
Ony what I found is add this property:
ScrollViewer.VerticalScrollBarVisibility=”Auto”
but in my app this doesn’t work
this is my xaml code:
<ListBox Height="776" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="776" Margin="11,12,0,0" Name="listBox1" Width="469">
<ListBox>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Column="0" Width="200" Grid.Row="0" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="1" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="2" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="3" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="4" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="5" Source="/a;component/texture.png" />
<Image Grid.Column="0" Width="200" Grid.Row="6" Source="/a;component/texture.png" />
<Image Grid.Column="1" Width="200" Grid.Row="0" Source="/a;component/texture.png" />
</Grid>
</ListBox>
</ListBox>
Thanks for any advice 😉
You have two
listboxeswrapped together. It seems like what you really want is aScrollViewer.