I have a radgrid that is bound dynamically within the code, the page size is set to 10 as you can see below, however
the paging isn't working correctly. All the rows are displayed and there is no option to page to the next page.
the grid is bound on the click of a button with the following code
grv_cand_shifts.DataSource = swaps.tbl_shifts_to_give_away;
grv_cand_shifts.DataBind();
please can you help.
<telerik:RadGrid ID="grv_cand_shifts" runat="server" AllowFilteringByColumn="True" AllowCustomColumns="True" AllowCustomPaging="True"
AllowPaging="True" ExportSettings-ExportOnlyData="true" ExportSettings-IgnorePaging="true" HeaderStyle-Wrap="true"
AllowSorting="True" GridLines="None" AutoGenerateColumns="False" Skin="<%$ AppSettings:TelerikControlSkin %>"
Width="100%" OnPreRender="grv_my_shifts_OnPreRender" OnDataBound="grv_cand_shifts_DataBound" PageSize="10" Message="" OnNeedDataSource="grv_cand_shifts_NeedDataSource" >
<MasterTableView DataKeyNames="id" Width="100%" >
<Columns>
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn DataField="id" HeaderText="id" SortExpression="id" UniqueName="id"
Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="shift_date" HeaderText="Shift date" ReadOnly="True"
UniqueName="shift_date" DataFormatString="{0:dd/MM/yyyy}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="start_time" ReadOnly="True" Visible="False" UniqueName="start_time"
HeaderText="Start Time">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="end_time" Visible="False" UniqueName="end_time"
HeaderText="End Time">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="person" HeaderText="Person" UniqueName="person"
SortExpression="person">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataField="rota_period_id" DataSourceID="sql_rota_period"
HeaderText="Rota period" ListTextField="label" ListValueField="id" UniqueName="rota_period_id">
<filtertemplate>
<telerik:RadComboBox ID="RadComboPeriod2" DataSourceID="sql_rota_period" DataTextField="label"
DataValueField="id" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("rota_period_id").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="Period2Changed">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
<script type="text/javascript">
function Period2Changed(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("rota_period_id", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</filtertemplate>
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="email" HeaderText="Contact" ReadOnly="True" UniqueName="email" Visible="False">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings >
<Selecting AllowRowSelect="True" />
<ClientEvents OnFilterMenuShowing="filterMenuShowing" OnGridCreated="getGridObject" />
</ClientSettings>
<PagerStyle AlwaysVisible="True" Mode="NumericPages" />
<ExportSettings ExportOnlyData="True" IgnorePaging="True">
</ExportSettings>
<FilterMenu OnClientShown="MenuShowing">
</FilterMenu>
<HeaderStyle Wrap="True" />
</telerik:Radgrid>
the paging isn't working correctly. All the rows are displayed and there is no option to page to the next page.
the grid is bound on the click of a button with the following code
grv_cand_shifts.DataSource = swaps.tbl_shifts_to_give_away;
grv_cand_shifts.DataBind();
please can you help.
<telerik:RadGrid ID="grv_cand_shifts" runat="server" AllowFilteringByColumn="True" AllowCustomColumns="True" AllowCustomPaging="True"
AllowPaging="True" ExportSettings-ExportOnlyData="true" ExportSettings-IgnorePaging="true" HeaderStyle-Wrap="true"
AllowSorting="True" GridLines="None" AutoGenerateColumns="False" Skin="<%$ AppSettings:TelerikControlSkin %>"
Width="100%" OnPreRender="grv_my_shifts_OnPreRender" OnDataBound="grv_cand_shifts_DataBound" PageSize="10" Message="" OnNeedDataSource="grv_cand_shifts_NeedDataSource" >
<MasterTableView DataKeyNames="id" Width="100%" >
<Columns>
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn DataField="id" HeaderText="id" SortExpression="id" UniqueName="id"
Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="shift_date" HeaderText="Shift date" ReadOnly="True"
UniqueName="shift_date" DataFormatString="{0:dd/MM/yyyy}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="start_time" ReadOnly="True" Visible="False" UniqueName="start_time"
HeaderText="Start Time">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="end_time" Visible="False" UniqueName="end_time"
HeaderText="End Time">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="person" HeaderText="Person" UniqueName="person"
SortExpression="person">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataField="rota_period_id" DataSourceID="sql_rota_period"
HeaderText="Rota period" ListTextField="label" ListValueField="id" UniqueName="rota_period_id">
<filtertemplate>
<telerik:RadComboBox ID="RadComboPeriod2" DataSourceID="sql_rota_period" DataTextField="label"
DataValueField="id" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("rota_period_id").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="Period2Changed">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
<script type="text/javascript">
function Period2Changed(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("rota_period_id", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</filtertemplate>
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="email" HeaderText="Contact" ReadOnly="True" UniqueName="email" Visible="False">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings >
<Selecting AllowRowSelect="True" />
<ClientEvents OnFilterMenuShowing="filterMenuShowing" OnGridCreated="getGridObject" />
</ClientSettings>
<PagerStyle AlwaysVisible="True" Mode="NumericPages" />
<ExportSettings ExportOnlyData="True" IgnorePaging="True">
</ExportSettings>
<FilterMenu OnClientShown="MenuShowing">
</FilterMenu>
<HeaderStyle Wrap="True" />
</telerik:Radgrid>