Server Side Paging

3 posts, 1 answers
  1. spam
    spam avatar
    10 posts
    Member since:
    Dec 2010

    Posted 27 Jan 2011 Link to this post

    I am using SQL server 2008, Entity Framework 4, SilverLight 4 in my application.

    I use a Telerik Grid that dynamically creates columns & pulls data from SQL using LINQ to Entity.

    I would like to change it to implement server side paging so that it doesn't pull all the data but rather when it needs to be displayed as we navigate.

    Is there any example someone can provide using Telerik grid, Linq to Entity?

    Thank you very much,


    Below is the code I want to modify when I ad the pager-------------

    DataServiceQuery<vwDraw> query = (from o in context.vwDraws
                                                  where o.ZoneLevelID == SelectedZoneLevel.ZoneLevelID &&
                                                        o.PubDate >= From &&
                                                        o.PubDate <= To
                                                  select o) as DataServiceQuery<vwDraw>;
                Count = query.Count();

                    (b) =>
                        Application.Current.RootVisual.Dispatcher.BeginInvoke(() =>
                            DataServiceQuery<vwDraw> D = b.AsyncState as DataServiceQuery<vwDraw>;
                                var items = D.EndExecute(b).ToList<vwDraw>();
                                foreach (var item in items)
                                    DrawFields df = new DrawFields();
                                    df.ZoneID = item.ZoneId;
                                    df.ZoneName = item.ZoneName;
                                    df.ZoneGroupID = item.ZoneGroupID;
                                    df.ZoneGroupName = item.ZoneGroupName;
                                    df.PubDate = item.PubDate;
                                    df.Qty = item.Qty;
                                View.BusyIndicator.IsBusy = false;
                                View.dg.ItemsSource = null;

                                if (DrawList.Count == 0)
                                    View.tbSaveStatus.Text = "No draws found!!";
                                    DrawList = null;
                                    DrawList = new List<DrawFields>();


                                    View.tbSaveStatus.Text = string.Empty;
                            catch (Exception exp)
                                throw exp;
  2. Answer
    Veselin Vasilev
    Veselin Vasilev avatar
    2992 posts

    Posted 28 Jan 2011 Link to this post


    Please take a look at this code library.

    Kind regards,
    Veselin Vasilev
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. spam
    spam avatar
    10 posts
    Member since:
    Dec 2010

    Posted 29 Jan 2011 Link to this post

    Thank you!
Back to Top