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

Paging in RadGridView

5 Answers 155 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Srini
Top achievements
Rank 1
Srini asked on 26 Sep 2009, 02:57 PM
I'm using SilverLight 3, Telerik Q2, with this how to achive paging in radGrid?

5 Answers, 1 is accepted

Sort by
0
Vlad
Top achievements
Rank 1
answered on 26 Sep 2009, 04:38 PM
You've missed this demo
0
andrea bellagamba
Top achievements
Rank 1
answered on 29 Sep 2009, 09:42 AM
HI
 I have implemented a RadGridView using RiaServices with DomainService.
My code is pretty much similar to the online demo.

I am able to get data from my domainservice, and to use the paging, but I have teh following problem:
the pager dpesn't show the total number of pages, and the filtering is applied ONLY to the displayed page data, and not on the entire set of data.

Am I doing something wrong? Here is my code

<riaControls:DomainDataSource x:Name="_contactDomainDataSource" AutoLoad="True" QueryName="GetCustomers"
                    LoadingData="ContactDomainDataSource_LoadingData" LoadedData="ContactDomainDataSource_LoadedData">
            <riaControls:DomainDataSource.DomainContext>
                <domainService:ContactContext/>
            </riaControls:DomainDataSource.DomainContext>
            <riaControls:DomainDataSource.FilterDescriptors>
                <riaData:FilterDescriptorCollection LogicalOperator="Or" />
            </riaControls:DomainDataSource.FilterDescriptors>
        </riaControls:DomainDataSource>

        <telerik:RadGridView x:Name="_contactsGrid"
                             Grid.Row="0" 
                             AutoGenerateColumns="False" 
                             HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                             Background="Transparent"
                             BorderThickness="0"
                             GridLinesVisibility="Horizontal"  
                             ItemsSource="{Binding Data, ElementName=_contactDomainDataSource}"  
                             Filtering="RadGridView1_Filtering"
                             >           
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="Email" Header="Email"  Width="*"/>
                <telerik:GridViewDataColumn UniqueName="Phone1" Width="*" Header="Phone(SMS)"/>               
                <telerik:GridViewDataColumn UniqueName="Company" Width="*"  Header="Company" />
                <telerik:GridViewDataColumn UniqueName="GivenName" Width="*" Header="Givenname" />
                <telerik:GridViewDataColumn UniqueName="SurName" Width="*" Header="Surname" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <data:DataPager x:Name="DataPager1" Grid.Row="1" PageSize="10"  Source="{Binding Data, ElementName=_contactDomainDataSource}"/>
   



0
Vlad
Telerik team
answered on 29 Sep 2009, 10:31 AM
Hello andrea ,

Filtering by default will be applied only on loaded data (current page) - you can check the example to know more about how to apply the grid filtering to the DomainDataSource. Can you provide more info about your context type? Generally only LINQ to SQL context have support for total number of pages - no such in Entity Framework.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
andrea bellagamba
Top achievements
Rank 1
answered on 29 Sep 2009, 11:54 AM
I am not using Linq To Sql, but my DomainService is returning an IQuerable, which is what you do in your do in your RiaService example. Here is teh code of my DomainService:

[EnableClientAccess()]
    public class ContactService : DomainService
    {

        public IQueryable<Data.Contact> GetContacts()
        {
            var membershipUser = Membership.GetUser();
            var user = UserLocator.Instance.FindByEmail(membershipUser.Email);
            var contactDatabase = user.ContactDataDatabases.FirstOrDefault();
            return (from c in contactDatabase.Get(0, int.MaxValue) select c as Data.Contact).AsQueryable();
        }
}


0
Vlad
Telerik team
answered on 02 Oct 2009, 06:22 AM
Hello andrea,

I'm not sure why DataPager control is not populated properly in your case however I'll gladly help you if you can send us small example (via support ticket) where this issue can be reproduced.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Srini
Top achievements
Rank 1
Answers by
Vlad
Top achievements
Rank 1
andrea bellagamba
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or