views:

633

answers:

2

Hi to all, I have a listview with several rows, the problem is that even if the vertical scrollbar is visible, it doesnt work, I explain, it seems that because the grid height is Auto, then there is no maximum height and all the content is displayed, even if part of it is not visible, the only part-solution I've found is to set pixel height to the grid, like 600, and then you can scroll the content of the listview, but obviuosly this is not a very good solution since I would like the height be defined by it's container, I have tried to bind the height property to ActualHeight of the TabItem, but that doesn't work either, I'm desperate so if anyone knows how to solve this problem I would highly appreciate it, thanks in advance.

Below is basically the code i'm using.

<TabItem Header="Orders">
     <Grid Height="Auto">
         <ScrollViewer>
              <ListView ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True" >
               </ListView>
          </ScrollViewer>
     </Grid>
</TabItem>
A: 

I believe the problem could be you have a scroll viewer surrounding a control (the ListView) that has a built in scroll viewer. Try removing the outer ScrollViewer.

Jerry Bullard
A: 

Hi Jerry, in fact the listview has a built in scroll viewer so I removed it, however the problem persist in the same manner, now I have the following:

<TabItem Header="Orders">
     <Grid Height="Auto" Margin="0,0,0,0">
          <ListView ItemsSource="{Binding}" HorizontalAlignment="Stretch" x:Name="listViewOrdenes" ScrollViewer.VerticalScrollBarVisibility="Visible">
          </ListView>
     </Grid>
 </TabItem>
Dont post unwanted answers, update it in your question.
Sauron