首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ListView DataPager不工作

ListView DataPager不工作
EN

Stack Overflow用户
提问于 2013-02-20 01:58:49
回答 1查看 3.2K关注 0票数 0

我有一个带DataPager的ListView

代码语言:javascript
复制
<asp:ListView ID="ProfilesList" runat="server" OnItemDataBound="ProfilesList_DataBound" >
               <LayoutTemplate>
                   <asp:DataPager runat="server" ID="ContactsDataPager" PageSize="12">
            <Fields>
              <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true"
                FirstPageText="|&lt;&lt; " LastPageText=" &gt;&gt;|"
                NextPageText=" &gt; " PreviousPageText=" &lt; " />
            </Fields>
          </asp:DataPager>
              <table cellpadding="0" cellspacing="0" class="GridBody" style="padding:0; width:910px; border-bottom-style:none;">
                    <tr class="GridHeader" style="text-align:center;">
                        <td style="width:8px; padding-left:5px; border-bottom-style:none; ">
                        </td>
                        <td style="width:274px; border-bottom-style:none;">
                            Person Info
                        </td>
                        <td style="width:273px; border-bottom-style:none;">
                            Company Info
                        </td>
                        <td style="width:272px; border-bottom-style:none;">
                            User Attributes
                        </td>
                    </tr>
                </table>
                  <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
              </div>
            </LayoutTemplate>

请记住,这只是ListView的第一部分,因为整个事情是巨大的。

无论如何,按钮出现了,但它们在all....do中没有做任何事情我必须在我的代码后面做一些事情吗?

EN

回答 1

Stack Overflow用户

发布于 2013-02-27 19:43:20

从ListView中提取DataPager,设置PagedControlID属性并实现PagePropertiesChanging方法:

代码语言:javascript
复制
//set current page startindex, max rows and rebind to false
ContactsDataPager.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
//rebind List View
BindListView();

请看这篇文章:http://dotnet.dzone.com/articles/paging-listview-using

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14964248

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档