Hello sir,
i am applying paging in list view. i used data pager control. but problem is on click of next page next data is not displaying only showing previous data.
i have one dropdown i am bing list view on dropdownindex change event not in page load.
plz advise me how will i do this. sharing my code.
<div id='main-content' style="overflow: auto; width: 100%" class="printable">
<asp:ListView ID="LSVAllSlips" runat="server" GroupItemCount="2" GroupPlaceholderID="groupPlaceholder1"
ItemPlaceholderID="itemPlaceholder1" OnPagePropertiesChanged="LSVAllSlips_PagePropertiesChanged">
<LayoutTemplate>
<table>
<tr id="Tr1" runat="server">
<td colspan="6" style="height: 2mm">
</td>
</tr>
<tr id="groupPlaceholder1" runat="server" align="center">
</tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<td id="itemPlaceholder1" runat="server">
</td>
</tr>
</GroupTemplate>
<ItemTemplate>
<td>
<div class="textRotate">
<asp:Image ID="imgUrl" runat="server" ImageUrl='<%# Eval("Image")%>' Height="10mm" /></div>
<%-- <asp:Label ID="lblmemid" runat="server" Text='<%# Eval("MemberShipid") %>' Font-Bold="True"--%>
<%--Font-Size="Larger" />--%>
</td>
<td align="left" style="width: 8.5cm; height: 32.15mm; background: #dedede;">
<asp:Label ID="lblname" runat="server" Text='<%# Eval("Name") %>' Font-Size="12px"
Font-Bold="true" /><br />
<asp:Label ID="lbladd" runat="server" Text='<%# Eval("Address") %>' Font-Size="12px" /><br />
<asp:Label ID="lblcity" runat="server" Text='<%# Eval("City") %>' Font-Size="12px" />,
<asp:Label ID="lblstate" runat="server" Text='<%# Eval("State") %>' Font-Size="12px" />
-
<asp:Label ID="lblpin" runat="server" Text='<%# Eval("Pincode") %>' Font-Size="12px" /><br />
<asp:Label ID="lblcountry" runat="server" Text='<%# Eval("Country") %>' Font-Size="12px" /><br />
Mob:
<asp:Label ID="lblmo" runat="server" Text='<%# Eval("Mobile1") %>' Font-Size="12px" /> 
Ph: 
<asp:Label ID="lblph" runat="server" Text='<%# Eval("Phone1") %>' Font-Size="12px" />
</td>
<td style="width: 5mm;">
</td>
</ItemTemplate>
<GroupSeparatorTemplate>
<tr id="Tr1" runat="server">
<td colspan="6" style="height: 2mm">
</td>
</tr>
</GroupSeparatorTemplate>
</asp:ListView>
<asp:DataPager ID="printlistpaging" runat="server" PagedControlID="LSVAllSlips" PageSize="16">
<Fields>
<asp:NextPreviousPagerField ShowNextPageButton="False" ButtonCssClass="previousNextLink" />
<asp:NumericPagerField ButtonCount="10" ButtonType="Link" NumericButtonCssClass="numericLink" />
<asp:NextPreviousPagerField ShowPreviousPageButton="False" ButtonCssClass="previousNextLink" />
</Fields>
</asp:DataPager>
</div>
cs code
protected void DDLprint_SelectedIndexChanged(object sender, EventArgs e)
{
if (DDLprint.SelectedIndex == 0)
{
LSVAllSlips.DataSource = "";
LSVAllSlips.DataBind();
}
else if (DDLprint.SelectedIndex == 1)
{
AllSlips();
}
else if (DDLprint.SelectedIndex == 2)
{
ValidSlips();
}
else if (DDLprint.SelectedIndex == 3)
{
CorrectedSlips();
}
}