排序,过滤,分组,分页时,我遇到以下内存问题:
我打开任务管理器来监控我的应用程序的内存,在加载所有数据(比如500列90列)后,应用程序的内存大小就像150mb,然后每次重复一个动作(我尝试重新排序任何列)记忆增加,增加,增加和永远不会释放
我尝试了与示例相同的测试用例,并在加载了一些内存后,GC释放了未使用的内存。
Plesae帮助,我会提供任何提示。
代码
<telerik:RadGridView Name="dataGrid" Margin="4" Grid.Row="3" ItemsSource="{Binding Items}" IsReadOnly="True" SelectionMode="Extended" AlternationCount="2" AlternateRowBackground="LightGray" FrozenColumnCount="{Binding FrozenColumnIndex}" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" view:GridViewHeaderMenu.IsEnabled="True" SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
<telerik:RadGridView.Columns>
<view:NumberColumn Header="#" Width="50" DataPager="{Binding ElementName=radDataPager1}" />
<telerik:GridViewDataColumn Header="Col1" HeaderTextAlignment="Center" DataType="{x:Type System:String}" DataMemberBinding="{Binding Value1}" view:GridColumnToolTip.TextTooltip="{Binding DataContext.ColumnsDescription.Value1ColumnTooltip, ElementName=userControl}"/>
<telerik:GridViewDataColumn Header="Col2" HeaderTextAlignment="Center" DataType="{x:Type System:Int32}" DataMemberBinding="{Binding Value2}" view:GridColumnToolTip.TextTooltip="{Binding DataContext.ColumnsDescription.Value2ColumnTooltip, ElementName=userControl}"/>
<telerik:GridViewDataColumn Header="Col3" HeaderTextAlignment="Center" DataType="{x:Type System:Double}" DataMemberBinding="{Binding Value3}" DataFormatString="N3" view:GridColumnToolTip.TextTooltip="{Binding DataContext.ColumnsDescription.Value3ColumnTooltip, ElementName=userControl}"/>
<telerik:GridViewDataColumn Header="Col Hide/Show Binding" HeaderTextAlignment="Center" DataType="{x:Type System:String}" DataMemberBinding="{Binding Value4}" IsVisible="{Binding IsIndividual}" view:GridColumnToolTip.TextTooltip="{Binding DataContext.ColumnsDescription.Value4ColumnTooltip, ElementName=userControl}"/>
<!--other 90 columns-->
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<StackPanel Orientation="Horizontal" Grid.Row="4" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center">
<telerik:RadDataPager x:Name="radDataPager1" PageSize="20" DisplayMode="All" Source="{Binding Items, ElementName=dataGrid}"
IsTotalItemCountFixed="True" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" Margin="8,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="10.667"><Run Text="Ta"/><Run Language="es-es" Text="maño de página:"/></TextBlock>
<telerik:RadNumericUpDown NumberDecimalDigits="0" Value="{Binding PageSize, ElementName=radDataPager1, Mode=TwoWay}" Minimum="1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>