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

1
  • That should actually work. I'm guessing its something outside of the code that you posted. what's your grid inside of? Commented Sep 4, 2009 at 13:21

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

2 Comments

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!
In my case the problematic Llistview was in page loaded inside a Frame. The Frame itself was inside a StackPanel and that was the culprit. So I would check the hierarchy all the way from the ListView to the root frame

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.