Use GridView as hierarchy. When GridView's row records extends 1000, browser response slowly (about 3 minutes). The same situation happen at RowDetails. Please help!
- xaml code:
<telerik:RadGridView Name="radGridView" ItemsSource="{Binding source}" IsReadOnly="True" AutoGenerateColumns="False"
RowIndicatorVisibility="Collapsed">
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding str1}"
Header="Test Hearder1"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding str2}"
Header="Test Hearder2"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding str3}"
Header="Test Hearder3"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding str4}"
Header="Test Hearder4"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding lstChild}" ShowGroupPanel="False" IsReadOnly="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding str1}"
Header="Test Hearder1"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding str2}"
Header="Test Hearder2"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding str3}"
Header="Test Hearder3"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding str4}"
Header="Test Hearder4"
Width="100" IsReadOnly="True" IsFilterable="true" IsSortable="True" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView> - cs code:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();List<DataEnt> source=new List<DataEnt>();
for (int i = 0; i < 50; i++)
{
DataEnt obj=new DataEnt();
obj.str1 = "test string";
obj.str2 = "test string";
obj.str3 = "test string";
obj.str4 = "test string";obj.lstChild = new List<DataEnt>();
for (int j = 0; j < 1000; j++)
{
DataEnt obj1 = new DataEnt();
obj1.str1 = "test string";
obj1.str2 = "test string";
obj1.str3 = "test string";
obj1.str4 = "test string";
obj.lstChild.Add(obj1);
}
source.Add(obj);
}radGridView.ItemsSource = source;
}
}public class DataEnt
{
public string str1 { get; set; }
public string str2 { get; set; }
public string str3 { get; set; }
public string str4 { get; set; }
public List<DataEnt> lstChild { get; set; }
}