This question is locked. New answers and comments are not allowed.
Hello,
I am trying to fix a performance issue when using HierarchyChildTemplate to create a hierarchical grid. Its having a huge performance issue when there are large amount of data / large strings in cells.
Here is the xaml code given .
I am trying to fix a performance issue when using HierarchyChildTemplate to create a hierarchical grid. Its having a huge performance issue when there are large amount of data / large strings in cells.
Here is the xaml code given .
<UserControl x:Class="GridBuildingBlock" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:telerikNs="http://schemas.telerik.com/2008/xaml/presentation" xmlns:Core="clr-namespace:System;assembly=mscorlib" Margin="0,0,0,5" xmlns:igWindows="http://infragistics.com/Windows" xmlns:buildingBlock="clr-namespace:BuildingBlocks" Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SizeChanged="UserControl_SizeChanged"> <UserControl.Resources> <telerik:Office_SilverTheme x:Key="Theme" /> <DataTemplate x:Key="Child1" > <telerikGrid:RadGridView x:Name="rgvChid1" ShowGroupPanel="False" CanUserSortColumns="False" telerik:StyleManager.Theme="{StaticResource Theme}" IsFilteringAllowed="False" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" Loaded="rgvChid_Loaded" Width="{Binding ElementName=rdgView,Path=ActualWidth}" > </telerikGrid:RadGridView> </DataTemplate> </UserControl.Resources>
<StackPanel Name="stkMain" Height="Auto"> <Grid Margin="0,5,0,7" > <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition MaxWidth="20" Width="{Binding Path=ActualWidth,ElementName=rgvMainSB}" ></ColumnDefinition> </Grid.ColumnDefinitions> <telerikGrid:RadGridView x:Name="rdgView" DataLoadMode="Synchronous" CanUserFreezeColumns="False" telerik:StyleManager.Theme="{StaticResource Theme}" AutoGenerateColumns="False" ColumnWidth="*" ShowGroupPanel="False" CanUserInsertRows="False" CanUserSortColumns="True" Sorting="rdgView_Sorting" VirtualizingStackPanel.VirtualizationMode="Recycling" CanUserDeleteRows="False" ScrollViewer.HorizontalScrollBarVisibility="Hidden" IsSynchronizedWithCurrentItem="True"> </telerikGrid:RadGridView> <ScrollBar x:Name="rgvMainSB" Width="20" Grid.Column="1" Orientation="Vertical" Visibility="Collapsed" ></ScrollBar> </Grid> </StackPanel> </UserControl>
And in the Main grid loaded event we are dynamically adding the columns to the main grid + setting the HierarchyChildTemplate property.
And in the child gridview loaded the child grids columns are being set.Private Sub rgvChid_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Dim rgv As RadGridView = DirectCast(sender, RadGridView) rgv.Width = rdgView.ActualWidth - 30 If TypeOf rgv.DataContext Is GenericPresentationObject Then rgv.ItemsSource = DirectCast(rgv.DataContext, GenericPresentationObject).Properties(_LayoutIdentityCollection.Values(0)) End If rgv.UpdateLayout() If rgv.Columns.Count = 0 Then Dim colConstruct As Reflection.ConstructorInfo For Each col In GetColumnCollectionForLayout(1) Dim grdcolumn As GridViewColumn colConstruct = col.GetType.GetConstructor(System.Type.EmptyTypes) If colConstruct IsNot Nothing Then grdcolumn = DirectCast(colConstruct.Invoke(Nothing), GridViewColumn) grdcolumn.CopyPropertiesFrom(col) rgv.Columns.Add(grdcolumn) End If Next If UseChildGridRowSelection Then AddHandler rgv.SelectionChanged, AddressOf rdgView_SelectionChanged End If CheckAndSetNewLayout(rgv, 2) End If End Sub
Please help me.