How can I achieve this - that GridView adjusts its size to available free space and still uses virtualization?
5 Answers, 1 is accepted
You can simply put RadGridView in a Grid panel with Row.Height = *. In this case RadGridView will occupy the whole available space and will provide scrollbar to scroll the items virtually.
Regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
telerik:RadBusyIndicator
Grid.Column
=
"0"
Grid.Row
=
"0"
IsBusy
=
"{Binding IsBusy, Mode=TwoWay}"
>
<
telerik:RadGridView
x:Name
=
"TabularPropertyView"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
AutoGenerateColumns
=
"False"
SelectionMode
=
"Extended"
RowIndicatorVisibility
=
"Collapsed"
SelectionUnit
=
"Cell"
RowHeight
=
"26"
EnableRowVirtualization
=
"True"
EnableColumnVirtualization
=
"True"
ScrollMode
=
"Deferred"
Sorting
=
"TabularPropertyView_Sorting"
ShowGroupPanel
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Owner.ResultTimestamp}"
Header
=
"{StaticResource FeatureEditor_Presentations_Observations_ResultTimestamp}"
IsCustomSortingEnabled
=
"True"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Owner.SamplingTimestamp}"
Header
=
"{StaticResource FeatureEditor_Presentations_Observations_SamplingTimestamp}"
IsCustomSortingEnabled
=
"True"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
telerik:RadBusyIndicator
>
More columns are added programmatically, average total number is about 10. This mark up takes about 15 seconds to render with 500 rows with custom DataTemplates. If I set Height on GridView, it takes only 1 second.
Just for info: this GridView is in a user control, that is added to a parent user control through template selector like this (i.e. GridView goes to the ContentControl):
<
UserControl
>
<
ContentControl
Content
=
"{Binding}"
ContentTemplateSelector
=
"..."
/>
</
UserControl
>
Can you replace RadGridView temporary with regular ListBox or DataGrid and let us know what is the result in your case?
All the best,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

I replaced your Grid with normal DataGrid:
<
telerik:RadBusyIndicator
IsBusy
=
"{Binding IsBusy, Mode=TwoWay}"
>
<
DataGrid
x:Name
=
"TabularPropertyView"
Height
=
"Auto"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
>
<
DataGridTextColumn
Binding
=
"{Binding Path=Owner.ResultTimestamp}"
Header
=
"{StaticResource FeatureEditor_Presentations_Observations_ResultTimestamp}"
/>
<
DataGridTextColumn
Binding
=
"{Binding Path=Owner.SamplingTimestamp}"
Header
=
"{StaticResource FeatureEditor_Presentations_Observations_SamplingTimestamp}"
/>
</
DataGrid
>
</
telerik:RadBusyIndicator
>
Then I add DataGridTemplatedColumns in code behind, based on bound object.
So the standard Grid performace in my case is about 40 second without placing it into a Row, and only 11 seconds when placing it into a row with Height="*". Telerik GridView in a Row performs however worse, displaying the same info in about 30 sec.
Maxim
What I was asking actually was if the standard components like ListBox and DataGrid are measured with infinity height similar to RadGridView in your case. Do you have vertical scrollbars for these components? Can you scroll vertically?
All the best,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.