1
<DataTemplate>
    <ScrollViewer>
        <Grid>
            ... same rows and controls 20% of screen
        </Grid>
        <ListView>
        </ListView>
    </ScrollViewer>
</DataTemplate>

With this template there are

  1. fixed Grid first

  2. scrollable ListView second

How create template with

  1. scrollable ListView at top

  2. fixed Grid at bottom

?

P.S. There are online or compiled demo different xaml layout/templates?

1 Answer 1

1

Don't put a ListView inside a ScrollViewer because you will lose virtualization if you are using it, which will degrade performance significantly.

If you want the Grid to always be visible then use the following:

<DataTemplate>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ListView Grid.Row="0"/>
        <Grid Grid.Row="1" Height="100"/> <!-- Set any fixed height -->
    </Grid>
</DataTemplate>

If you want the Grid to scroll with the list use a Footer:

<DataTemplate>
    <ListView>
        <ListView.Footer>
            <!-- Set any fixed height -->
            <Grid Height="100"/>
        </ListView.Footer>
    </ListView>
</DataTemplate>
Sign up to request clarification or add additional context in comments.

Comments

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.