Created
March 20, 2014 04:24
-
-
Save RyanABailey/9657239 to your computer and use it in GitHub Desktop.
ListView Paging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10"> | |
<Fields> | |
<asp:NumericPagerField ButtonType="Link" /> | |
</Fields> | |
</asp:DataPager> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e) | |
{ | |
//set current page startindex, max rows and rebind to false | |
lvDataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false); | |
// bind data to list view | |
BindData(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:ListView ID="ListView1" runat="server" OnPagePropertiesChanging="ListView1_PagePropertiesChanging"> | |
<LayoutTemplate> | |
<ul> | |
<asp:PlaceHolder ID="itemPlaceholder" runat="server" /> | |
</ul> | |
</LayoutTemplate> | |
<ItemTemplate> | |
<li> | |
<%# Eval("DataField") %> | |
</li> | |
</ItemTemplate> | |
<EmptyDataTemplate> | |
No data to display | |
</EmptyDataTemplate> | |
</asp:ListView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment