none
WPF ListView scrollable height

    Question

  • I am using the WPF ListView, with an embedded GridView, to display a table of data. When the scroll bar is present, I would like to slightly increase the scrollable height of the list, making a little more visible white space at the end of the list.

    Note, I do NOT want to accomplish this by adding additional empty rows to the list.

    Any ideas on how to accomplish this?

    Thanks,

    Aaron Stibich
    Tuesday, May 11, 2010 6:38 PM

Answers

  • You can hook onto the LayoutUpdate event of the ListView to check for ScrollBar visibility...at that point I'd just increase/decrease the height of your control based on whether the ScrollBar is visible or not....here's an article of someone who had a somewhat similar issue:

    http://blogs.windowsclient.net/anshulee/archive/2008/03/26/wpf-figure-out-dynamically-if-the-listview-scrollviewer-is-showing.aspx

     

    Hope it helps,

    Aj


    If at first you don't succeed, skydiving is definitely not for you!
    • Proposed as answer by aaj23 Tuesday, May 11, 2010 7:16 PM
    • Marked as answer by Linda Liu Wednesday, May 19, 2010 3:48 AM
    Tuesday, May 11, 2010 7:16 PM