Hi,
I've been tasking with scrubbing our use of Telerik (which is extensive in our app) for memory usage and possible efficiencies, as customers are concerned about high memory usage of our app, and speed.
RadGridView has been flagged as a likely candidate as a "memory hog" for customers that have over 1,000 records loaded at any given time.
Here is a snapshot of our implementation:
<telerik:RadGridView AutomationProperties.Name="EventSummaryGrid" x:Name="EventSummaryGrid" Grid.Row="1" Grid.Column="0"
HeaderRowStyle="{DynamicResource THOR_GridViewHeaderRowStyle}"
local:GridDependencyProperties.ColumnCollection="{Binding ColumnCollection}"
IsReadOnly="True" EnableColumnVirtualization="True"
CanUserDeleteRows="False"
CanUserInsertRows="False"
ShowGroupPanel="True"
AlternationCount="2"
RowIndicatorVisibility="Collapsed"
AutoExpandGroups="True"
MouseDoubleClick="EventSummaryGrid_MouseDoubleClick"
ItemsSource="{Binding EventSummaryList}"
AutoGenerateColumns="False"
RowIsExpandedChanged="EventSummaryGrid_RowIsExpandedChanged"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionMode="Extended" ShowColumnSortIndexes="False"
ClipboardCopyMode="All"
FieldFilterEditorCreated="EventSummaryGrid_FieldFilterEditorCreated"
Loaded="EventSummaryGrid_Loaded"
Sorting="EventSummaryGrid_Sorting">
<telerik:RadGridView.Resources>
<local:SensorTypeConverter x:Key="SensorTypeConverter" />
<local:SensorUnitsConverter x:Key="SensorUnitsConverter" />
<local:EventTypeConverter x:Key="EventTypeConverter" />
<local:StorageTypeConverter x:Key="StorageTypeConverter" />
<local:RecordLengthConverter x:Key="RecordLengthConverter" />
<local:SampleRateConverter x:Key="SampleRateConverter" />
<local:NoOfChannelsConverter x:Key="NoOfChannelsConverter" />
<local:NoUsbOfChannelsConverter x:Key="NoUsbOfChannelsConverter" />
<local:NumberOfIntervalsConverter x:Key="NumberOfIntervalsConverter" />
<local:DateTimeToStringConverter x:Key="DateTimeToStringConverter" />
<local:TriggerConverter x:Key="TriggerConverter" />
</telerik:RadGridView.Resources>
- The grid has 60 columns, and filtering and sorting is on for all of them.
Here is an example of a typical column implementation:
<telerik:GridViewDataColumn x:Name="FileName" DataMemberBinding="{Binding FileName}"
Header="{x:Static Resources:Resources.EventManagerView_Column_FileName}"
HeaderTextAlignment="Center" TextWrapping="NoWrap" TextTrimming="WordEllipsis" HeaderTextTrimming="WordEllipsis"
CellStyle="{DynamicResource THOR_GridViewCellStyle}"
IsVisible="True">
<telerik:GridViewDataColumn.HeaderCellStyle>
<Style TargetType="telerik:GridViewHeaderCell">
<Setter Property="ToolTipService.ToolTip" Value="{x:Static Resources:Resources.EventManagerView_Column_FileName}">
</Setter>
</Style>
</telerik:GridViewDataColumn.HeaderCellStyle>
</telerik:GridViewDataColumn>
..and we use a child template:
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<telerik:Label Margin="30,0,0,0" FontSize="12" FontWeight="Bold" Content="{x:Static Resources:Resources.Saved_Event_Report_Label}"/>
<telerik:RadGridView x:Name="ReportAnnotationsGrid"
GroupRenderMode="Flat"
BorderThickness="0,1,0,1"
AlternationCount="0"
GridLinesVisibility="None"
CanUserFreezeColumns="False"
AutoGenerateColumns="False"
ItemsSource="{Binding Annotations}"
ShowGroupPanel="False"
ShowColumnHeaders="False"
IsReadOnly="True"
MouseDoubleClick="ReportSelection_MouseDoubleClick"
GotFocus="ReportAnnotationsGrid_GotFocus"
SelectionChanged="ReportSelection_SelectionChanged"
CanUserDeleteRows="False"
CanUserInsertRows="False"
IsFilteringAllowed="False"
FrozenColumnCount="0"
FrozenColumnsSplitterVisibility="Collapsed"
RowIndicatorVisibility="Collapsed"
SelectionMode="Single"
Margin="30,0,0,0">
...any suggestions on settings to keep the memory usage to a bare minimum would be appreciated !