简体   繁体   English

ASP.NET GridView不显示我的PagerTemplate

[英]ASP.NET GridView doesn't display my PagerTemplate

I have the following code in my user control: 我的用户控件中包含以下代码:

<asp:LinqDataSource ID="myLinqDataSource" runat="server" AutoSort="true"
  ContextTypeName="MyDBContext" TableName="myTable" AutoPage="true"
  Select="new(Edited, Activity)" Where="UserID == 4" />

<asp:GridView ID="gvTable" runat="server" ShowHeader="true"
  PageSize="5" AllowPaging="true" AllowSorting="true"
  DataSourceID="myLinqDataSource" AutoGenerateColumns="false"
  OnRowDataBound="GridView_DataBound">
  <Columns>
    <asp:BoundField DataField="Edited" HeaderText="Date" DataFormatString="{0:d}" />
    <asp:BoundField DataField="Activity" HeaderText="Notes" />
  </Columns>
  <PagerSettings Position="Bottom" />
  <PagerStyle BackColor="Black" ForeColor="White" Wrap="false" />
  <PagerTemplate>
    Hello there
  </PagerTemplate>
</asp:GridView>

For some reason, no matter what I do, the pager isn't rendered at all. 由于某种原因,无论我做什么,都不会显示寻呼机。 Why? 为什么?

It isn't even shown if I remove the PagerTemplate tag and use some standard Mode setting in PagerSettings . 如果我删除PagerTemplate标记并在PagerSettings使用一些标准的Mode设置,则PagerSettings I'm going crazy! 我要疯了!

UPDATE: 更新:

After doing some exhaustive googling, I find that I'm probably using a very old version of the CSS Friendly Control Adapters. 在经过详尽的谷歌搜索之后,我发现我可能正在使用非常老版本的CSS Friendly Control Adapters。 I believe so since this bug has struck me as well! 我相信,因为这个错误也打击了我! So how do I know what version of these adapters that I'm using? 那么我怎么知道我正在使用这些适配器的哪个版本? I wasn't even aware I was using them! 我什至不知道我在用它们!

UPDATE 2: 更新2:

The problem was that I was using an old version of CSS Friendly Control Adapters. 问题是我使用的是旧版本的CSS Friendly Control Adapters。 I downloaded the latest source code, compiled it, used the new DLL and .browser file and now it works just fine. 我下载了最新的源代码,对其进行了编译,使用了新的DLL和.browser文件,现在一切正常。 I'm leaving this question here so anyone experiencing the same issue may find help from it. 我将这个问题留在这里,以便任何遇到相同问题的人都可以从中寻求帮助。

The problem was that I was using an old version of CSS Friendly Control Adapters. 问题是我使用的是旧版本的CSS Friendly Control Adapters。 I downloaded the latest source code, compiled it, used the new DLL and .browser file and now it works just fine. 我下载了最新的源代码,对其进行了编译,使用了新的DLL和.browser文件,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM