views:

321

answers:

1

I am trying to design a view with a datagrid a grid splitter and a bottom panel that contains some messages. Something like:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="10"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <toolkit:DataGrid Grid.Row="0" {details...} />
    <GridSplitter Grid.Row="1" {details...} />
    <TextBox Grid.Row="2" {details...} />
</Grid>

This layout looks perfect - the grid fills the majority of the view and I have the splitter to expand the textbox at the bottom if necessary. The problem is that the Datagrid gets very large and I need virtualization enabled. This only works if an explicit height is given to the container of the grid I believe?

Is there a way to get the layout I want (where the grid fills all available space) but also have virtualization enabled?

+1  A: 

Is there a way to get the layout I want (where the grid fills all available space) but also have virtualization enabled?

Virtualization should work fine in the scenario you describe, as long as the parent of the Grid is not measuring it to infinity in the vertical direction. If that were the case, the splitter wouldn't work.

How are you determining that the rows within your DataGrid are not being virtualized?

Note that the DataGrid does have an explicit height in your scenario. More specifically, the parent Grid still measures the DataGrid to an explicit height (the vertical space remaining in the Grid after accounting for the other rows).

Dr. WPF