This is a migrated thread and some comments may be shown as answers.

GridView's hierarchy Performance Problem

1 Answer 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
wang
Top achievements
Rank 1
wang asked on 29 Oct 2012, 09:08 AM

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!

  1. 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>
  2. 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; }
        }

     

     

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 29 Oct 2012, 09:16 AM
Hello,

 You need to define Height for your child grid. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
wang
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or