RadGrid filter and paging

4 posts, 0 answers
  1. Matteo Beretta
    Matteo Beretta avatar
    21 posts
    Member since:
    Apr 2010

    Posted 18 May 2010 Link to this post

    Hi, i have a management problem,

    i have a grid that have a query as datasource, grid is enabled to filter and paging, when i filter, it filter for all pages, 

    so the result is:

    Page1 - result

    Page2 - result etc etc

    i want the it filtering for all the pages and then refresh the number of pages;

    Now post some code because mi english is bad:

    thank you.

    <telerik:RadScriptManager runat="server" ID="Scipr"></telerik:RadScriptManager>  
    <telerik:RadGrid runat="server" ID="rgrProva" Skin="Hay"   
            AutoGenerateColumns="false" AllowFilteringByColumn="true"  
            onpageindexchanged="rgrProva_PageIndexChanged" EnableLinqExpressions="false"  
            onneeddatasource="rgrProva_NeedDataSource" >  
        <PagerStyle Mode="NumericPages" />  
        <Selecting  AllowRowSelect="true"/>  
                <telerik:GridNumericColumn UniqueName="colAnno" DataField="RIC.reqann">  
                <telerik:GridNumericColumn UniqueName="colNumero" DataField="RIC.reqnum" FilterControlWidth="40px"   
                AutoPostBackOnFilter="false" CurrentFilterFunction="Contains" FilterDelay="4000" ShowFilterIcon="false">  
                <telerik:GridBoundColumn UniqueName="colCliente" DataField="RIC.reqcli">  

       protected void Page_Load(object sender, EventArgs e)  
            private void _Load(int PageNumber)  
                rgrProva.AllowPaging = true;  
                rgrProva.PageSize = 15;  
                rgrProva.PagerStyle.Mode = GridPagerMode.NumericPages;  
                rgrProva.AllowCustomPaging = true;  
                FinitenessEntities context = new FinitenessEntities();  
                var qReq = from n in context.RICHIESTE  
                           orderby n.reqann, n.reqnum  
                           select new {RIC = n };  
                rgrProva.VirtualItemCount = qReq.Count();  
                rgrProva.DataSource = qReq.Skip(rgrProva.PageSize * PageNumber).Take(rgrProva.PageSize);  
            protected void rgrProva_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)  
            protected void rgrProva_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  

  2. Tsvetoslav
    Tsvetoslav avatar
    1823 posts

    Posted 19 May 2010 Link to this post

    Hello Matteo,

    RadGrid supports out-of-the-box the scenario of filtering and paging you have described. However, if you do need to use custom paging, the following online example shoud guide you in that:

    Hope it helps.

    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.
  3. Carlos
    Carlos avatar
    96 posts
    Member since:
    Apr 2013

    Posted 12 Jan 2017 Link to this post

    Hi all,


    does anybody has the solution for, Matteo Beretta, problem i have the same problem, i think every body does.

    - have paging working fine, and i have the filters of the radgrid.

    - When i filter the rad grid, the paging mantains the number of pages it had before the filter.

    e.g. if i have 100 pages of data, and filter, it will continue to show 100 pages even knowing that the filter only has twoo rows.

    This is not custom paging problem, its something else


  4. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 16 Jan 2017 Link to this post

    Hi Carlos,

    You can take a look at the implementation in the following online demo:
    As you will notice in the code-behind, the custom paging is disabled when there are filter or sort expressions applied and this is due to the fact that the filtering and the sorting will be performed over the DataSource of the grid. 

    Konstantin Dikov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top