Peter Morris
Peter Morris

Reputation: 23224

WPF - Making ListView (GridView) Scroll when too much data?

<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 the 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

Upvotes: 2

Views: 4463

Answers (1)

Kent Boogaart
Kent Boogaart

Reputation: 178650

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

Upvotes: 4

Related Questions