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

Paging & Data Loading with RadGridView

3 Answers 109 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 10 May 2011, 09:42 PM
Hey Telerik Team -

I've got a RadGridView & RadDataPager bound to a QueryableCollectionView in my ViewModel. In my service callback, I set my QCV to an ObservableCollection which is successfully returning ~1200 rows. My DataPager.PageSize is set to 20, and on page load, I can see "Page 1 of 61". My RGV however is empty. If I sort, group, filter, or page my data is displayed in my RGV, but not until I call any one of these.
<telerik:RadGridView x:Name="WOAGridView"
    ItemsSource="{Binding WorkOrders}"
    HorizontalAlignment="Left"
    AutoGenerateColumns="False"
    IsReadOnly="True" />
<telerik:RadDataPager Grid.Row="1" Source="{Binding WorkOrders}" PageSize="20"/>

Here's where I'm setting the WorkOrders:
private void GetWorkOrdersCallback(ObservableCollection<TSMVVM.Model.WorkOrders> workOrders)
       {
           if (workOrders != null)
           {
               if (workOrders.Count > 0)
               {
                   WorkOrders = new QueryableCollectionView(workOrders);
               }
           }
       }

In the setter of my WorkOrders property, I'm calling RaisePropertyChanged, as my ViewModels all implement INotify.

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 May 2011, 06:33 AM
Hi,

 Unfortunately it will be impossible to tell you what's going on just by this code. Can you replace RadGridView temporary with ListBox to see what will be the result? 

Best wishes,
Vlad
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
Scott
Top achievements
Rank 1
answered on 17 May 2011, 09:21 PM
Sorry for the delay in getting back to you. Replacing my RadGridView with

<ListBox ItemsSource="{Binding Assemblies}"></ListBox>

Results in the records being displayed on page load. I can paginate these with no problem.

As soon as I removed "DataLoadMode=Asynchronous" it started working. I have that on 20 other RadGridViews in this app and it works no sweat. Not sure why that would cause the issue...
0
Vlad
Telerik team
answered on 18 May 2011, 07:21 AM
Hi,

 Are you loading the data from a service in this scenario? If this is the case please remove Asynchronous DataLoadMode setting since the binding itself is asynchronous. 

Kind regards,
Vlad
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
Scott
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Scott
Top achievements
Rank 1
Share this question
or