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

[Solved] RadGrid Paging

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 20 May 2008, 01:24 AM
Hi,

My question is, how do I refresh the pager controls.  Problem is, paging is working perfectly fine except when I do a search that returns like 20 results the first time, it will display say 2 pages(10/page), but when I do another keyword search which returns only 1 result, the number of pages still says 2 instead of just 1.  I cant seem to find any refresh functionality for the grid..plz advice.

here is a snippet of my code:  Search will call loadGrid everytime
loadGrid()
{
           // Database call etc here...cut
            grdResult.DataSource = newList;
            grdResult.DataBind();
}

ASPX:

<telerik:RadGrid ID="grdResult" runat="server" style="width:auto;"
                            GridLines="None" AutoGenerateColumns="false"
                            AllowSorting="true" AllowCustomPaging="true"
                            AllowMultiRowSelection="True"
                            AllowPaging="True" ShowHeader="true"
                            PagerStyle-AlwaysVisible="true"
                            OnItemCreated="grdResult_ItemCreated"
                            OnPageIndexChanged="grdResult_PageIndexChanged"
                            OnItemDataBound="grdResult_ItemDataBound" OnSortCommand="grdResult_SortCommand">
---//Columns here etc...MasterTableView etc...
 </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 May 2008, 07:24 AM
Hi Josh,

Try binding the Grid in the NeedDataSource event. Built-in features like Paging, Sorting, Filtering etc work only with AdvanceDataBinding techniques. Go through the following demo link to get details about AdvanceDataBinding techniques.
Advanced data-binding

Thanks
Princy.
Tags
Grid
Asked by
Josh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or