Pergunta

Estou tentando projetar uma exibição com um datagrid um divisor de grade e um painel inferior que contém algumas mensagens. Algo como:

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

Esse layout parece perfeito - a grade preenche a maior parte da vista e eu tenho o divisor para expandir a caixa de texto na parte inferior, se necessário. O problema é que o datagrid fica muito grande e eu preciso da virtualização ativada. Isso só funciona se uma altura explícita for dada ao recipiente da grade, eu acredito?

Existe uma maneira de obter o layout que eu quero (onde a grade preenche todo o espaço disponível), mas também ter virtualização ativada?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top