DataPagerコントロールを使用するサーバーコントロールを作成しようとしていますが、PagerTemplateで問題が発生しています。
これは、サーバーコントロールから生成したいDataPagerコントロールです。
<asp:DataPager ID="myPager" PageSize="20" runat="server">
<Fields>
<asp:TemplatePagerField>
<PagerTemplate>
<div class="counter">
<%# Container.StartRowIndex + 1 %> to
<%# ((Container.StartRowIndex + Container.PageSize) > Container.TotalRowCount ? Container.TotalRowCount : (Container.StartRowIndex + Container.PageSize)) %>
of <%# Container.TotalRowCount %> records
</div>
</PagerTemplate>
</asp:TemplatePagerField>
<asp:NextPreviousPagerField ButtonType="link"
FirstPageText="first"
ShowFirstPageButton="true"
ShowNextPageButton="false"
ShowPreviousPageButton="false"
RenderDisabledButtonsAsLabels="true" />
<asp:NumericPagerField ButtonCount="7" />
<asp:NextPreviousPagerField ButtonType="link"
LastPageText="last"
ShowLastPageButton="true"
ShowNextPageButton="false"
ShowPreviousPageButton="false" />
</Fields>
</asp:DataPager>
コードからPagerTemplateを作成する方法がわかりません。ITemplateを作成する必要がある部分で立ち往生していますが、それを操作する方法がわかりません。
いくつか検索しましたが、役立つものは見つかりませんでした。私はサーバーコントロールの初心者です。簡単なものもいくつかできますが、テンプレートは初めてです。
誰かが私にこれについていくつかの助けを与えることができますか?
ありがとう :)