WPF XAML ListView with ScrollBars

后端 未结 2 452
既然无缘
既然无缘 2020-12-22 05:28

I have a ListView which is showing both scroll bars. To achieve that, I places my ListView within a Border located in a Grid like below:



        
相关标签:
2条回答
  • 2020-12-22 06:21

    Hi I think i have understand you. So, i am trying:

    So, you want to have your ListView at least a height of 370 and then only resizes if the window resizes (increment and decrement of window size).

    Setting MinHeight of 2nd RowDefinition could help

    <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="32"/>
                <RowDefinition MinHeight="370"/>  <!-- THIS IS HARDCODED....-->
            </Grid.RowDefinitions>
    .....
    </Grid>
    

    Thank you.

    0 讨论(0)
  • 2020-12-22 06:33

    If I understand your question correctly, you are saying the form loads as too large of a size because the ListView is growing to it's full height. If that's the case, remove the SizeToContent="Height" from the <Window> tag since it is making the window's initial height be equal to whatever height the content is, which includes the fully sized ListView.

    0 讨论(0)
提交回复
热议问题