Paging in RadGridView

6 posts, 0 answers
  1. Srini
    Srini avatar
    41 posts
    Member since:
    Jul 2009

    Posted 26 Sep 2009 Link to this post

    I'm using SilverLight 3, Telerik Q2, with this how to achive paging in radGrid?
  2. Vlad
    Vlad avatar
    15 posts
    Member since:
    Oct 2004

    Posted 26 Sep 2009 Link to this post

    You've missed this demo
  3. DevCraft banner
  4. andrea bellagamba
    andrea  bellagamba avatar
    43 posts
    Member since:
    Jul 2009

    Posted 29 Sep 2009 Link to this post

    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}"/>
       



  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 29 Sep 2009 Link to this post

    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.
  6. andrea bellagamba
    andrea  bellagamba avatar
    43 posts
    Member since:
    Jul 2009

    Posted 29 Sep 2009 Link to this post

    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();
            }
    }


  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 02 Oct 2009 Link to this post

    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.
Back to Top
DevCraft banner