tags:

views:

579

answers:

2
<Grid>
  <ListView ItemsSource="....">
    <ListView.View>
      <GridView>
        <GridViewColumn ......../>
      </GridView>
    </ListView.View>
  </ListView>
</Grid>

When there are thousands of rows the above XAML causes the grid to size larger than the form and data becomes hidden.

What I want to do is to keep the ListView so that it fills the grid (which fills the form), and to have a vertical scrollbar to scroll through the items (leaving the header row in place at the top). Just like a WinForm grid would.

Can anyone tell me how to achieve this? I don't want to use 3rd party components.

Thanks

+1  A: 

Presumably your Grid is hosted in a StackPanel. Get rid of that and it should work fine.

HTH, Kent

Kent Boogaart
Yep, I had a stack panel to put a label above the ListView. I switched to using Margin instead and now the scrollbar appears.Thanks!
Peter Morris
A: 

Use item conterator generator

Mayank