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

[Solved] Is Child GridViewTable limited to 58 records only?

3 Answers 97 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vit100
Top achievements
Rank 1
Vit100 asked on 30 Sep 2010, 05:03 PM
Hi Guys,
I faced issue with GridView and Child table - somehow child shows only 58 records. Idea is that Customer has list of Sites, and child table shows only 58 site.... must show 100, as I load 100 sites for each customer... Well, this is just example (i can upload test project)...
Pls have a look ...Looks like it is bug..



<telerik:RadGridView 
  ItemsSource="{Binding PagedSource,ElementName=radDataPager}"
  RowIsExpandedChanging="RadTreeListView_RowIsExpandedChanging" 
  RowLoaded="RadTreeListView_RowLoaded">
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition/>
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView ItemsSource="{Binding Sites}"/>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>

This is ViewModel:
public class VM : ModelBase
    {
        private ObservableCollection<CustomerSearchResult> _Customers = new ObservableCollection<CustomerSearchResult>();
        public ObservableCollection<CustomerSearchResult> Customers
        {   get { return _Customers; }
            set {
                if (_Customers != value)
                {_Customers = value;  RaisePropertyChangeEvent("Customers");}
            }
        }
  
//Here we load 100 record in main/parent table
        public void LoadCustomers()
        {
            for (int i = 0; i < 100; i++)
            {
                var csr = new CustomerSearchResult()
                {   Firstname = "Name" + i.ToString(),
                    SiteCount = i
                };
                Customers.Add(csr);
            }
        }
  
//and here we load child items. lets load 100 as well
        public void LoadSite(CustomerSearchResult customer)
        {
            for (int i = 0; i < 100; i++)
            {
                customer.Sites.Add(new SiteModel() { Commodity = "My commodity" + i });
            }
        }

This is my Code Behind to emulate LoadOnDemand behavior...
private void RadTreeListView_RowIsExpandedChanging(object sender, RowCancelEventArgs e)
        {
            var csr = e.Row.Item as CustomerSearchResult;
            if (csr != null && csr.SiteCount > 0 && csr.Sites.Count == 0)
            {
                vm.LoadSite(csr);
            }
        }
  
        private void RadTreeListView_RowLoaded(object sender, RowLoadedEventArgs e)
        {
            GridViewRow row = e.Row as GridViewRow;
            var csr = e.Row.Item as CustomerSearchResult;
  
            if (row != null && csr != null)
            {
                row.IsExpandable = csr.SiteCount > 0 ? true : false;
            }
        }

3 Answers, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 30 Sep 2010, 05:13 PM
Hello Vit100,

 Could you please try setting an explicit height of the RadGridView inside the HierarchyChildTemplate so as to force the scrollbars on the child GridView to appear if needed? Perhaps that's the problem.

All the best,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vit100
Top achievements
Rank 1
answered on 30 Sep 2010, 05:32 PM
Bingo!!!
Thanks Yavor!!!

Also it speeded up Grid... Nice -)

One more thing, need your advice.. In example above I emulate loadOnDemand behavior and wonder if it is possible to have loadOnDemand animation icon (like in tree) when child is loading... I don't want to use IsBusy for whole GridView, as user may start load on demand for more then one record at the same time..
0
Yavor Georgiev
Telerik team
answered on 30 Sep 2010, 09:36 PM
Hello Vit100,

 Unfortunately that is not possible without a custom row template.

Kind regards,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Vit100
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Vit100
Top achievements
Rank 1
Share this question
or