WPF Datagrid virtualization and auto height (not explicit)

I am trying to create a view using a datagrid grid divider and a bottom bar containing some posts. Sort of:

<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 most of the view, and I have a splitter to expand the text box below if necessary. The problem is that the Datagrid is getting really big and I need virtualization. Does this only work if an explicit height is given to the mesh container that I believe in?

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

+4
source share
1 answer

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

Virtualization should work well in the scenario you are describing if the parent of the grid does not measure it ad infinitum in the vertical direction. If so, the splitter will not work.

How do you determine if rows in your DataGrid are not virtualized?

Note that the DataGrid has an explicit height in your script. More specifically, the parent grid still measures the DataGrid to an explicit height (the vertical space left in the Grid after considering the other rows).

+2
source

Source: https://habr.com/ru/post/1300898/


All Articles