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>
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>