am facing problem in custom paging of grid.am returning 5 rows frm stored proc
and my page size of grid is 5 .virtual count am setting to 2 from database (number of records from that particular table is 9.)
problem is that my grid is not displaying the pager template
below is the code
<
radG:RadGrid ID="rgDepartmentList" runat="server" Width="99%" AllowPaging="True" AllowCustomPaging="true" OnPageIndexChanged="rgDepartmentList_PageIndexChanged"
AllowSorting="True" ShowStatusBar="True" GridLines="None" AutoGenerateColumns="False" PageSize="5">
<MasterTableView CommandItemDisplay="Top" DataKeyNames="dept_id" RowIndicatorColumn-Display="false">
<NoRecordsTemplate>
<table width="99%" align="center">
<tr>
<td>
No record found.
</td>
</tr>
</table>
</NoRecordsTemplate>
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Resizable="False" Visible="False">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<radG:GridTemplateColumn HeaderText="Edit" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="30px"
ItemStyle-Width="30px">
<ItemTemplate>
<img onclick=" NavigateToEdit('<%# Eval("dept_id") %>','<%# Eval("dept_active") %>','<%# Eval("dept_name") %>');"
style="cursor: pointer;" alt="Edit" src="../../../Images/common/edit.gif" />
</ItemTemplate>
</radG:GridTemplateColumn>
<radG:GridButtonColumn HeaderText="Delete" ButtonType="ImageButton" CommandName="Delete"
ConfirmText="Do you want to delete this record?" ImageUrl="../../../Images/common/DeleteImage.JPG"
Text="Delete" UniqueName="column1">
<HeaderStyle HorizontalAlign="Center" Width="40px" />
<ItemStyle HorizontalAlign="Center" Width="40px" />
</radG:GridButtonColumn>
<radG:GridTemplateColumn HeaderText="Active">
<ItemTemplate >
<asp:CheckBox ID="chkbox" runat="server" Checked='<%# Bind("dept_active") %>' />
</ItemTemplate>
</radG:GridTemplateColumn>
<radG:GridBoundColumn HeaderText="Department Name" DataField="dept_name" UniqueName="dept_name">
</radG:GridBoundColumn>
</Columns>
<CommandItemTemplate>
<table class="CommandItemTemplate" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<img alt="" src="../../../Images/common/register.gif" /></td>
<td>
<a id="A1" onclick="NavigateToAdd();" href="#">Add Department</a>
</td>
<td>
</td>
<td>
</td>
<td>
<img src="../../../Images/common/button_refresh.gif" alt="" />
</td>
<td>
<asp:LinkButton ID="lbtnRefresh" Text="Refresh" runat="server" CommandName="Refresh"
onmouseover="OnRefreshCommandMouseOver();" onmouseout="OnRefreshCommandMouseOut();"></asp:LinkButton>
</td>
<td width="*">
</td>
</tr>
</table>
</td>
</tr>
</table>
</CommandItemTemplate>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
<ClientSettings EnableClientKeyValues="True" AllowColumnsReorder="true" ApplyStylesOnClient="true"
ReorderColumnsOnClient="True">
<ClientEvents OnRowClick="" OnRowSelected="RowSelected" />
<Selecting AllowRowSelect="true" />
<Resizing AllowColumnResize="true" AllowRowResize="true" ResizeGridOnColumnResize="false"
ClipCellContentOnResize="true" EnableRealTimeResize="false" />
</ClientSettings>
</
radG:RadGrid>
Code behind is
Private
Sub LoadGrid(ByVal currentindex As Integer)
Dim totalrecords As Integer = 0
Dim ds As New DataSet
ds = SFSetupDepartments.GetDepartmentsByPage((currentindex + 1), 5, totalrecords)
With rgDepartmentList
.MasterTableView.VirtualItemCount = (totalrecords / .PageSize)
.DataSource = ds.Tables(0)
.DataBind()
End With
End Sub
Please let me know the same as early as possible ? thanks guys