GridView のカスタム ページネーションを作成していますが、これまでのところ、このこと以外はすべて行っています。選択したページを別の色、別のフォント スタイル、または必要なもので強調表示したいと考えています。たとえば、ページ 1 2 3 4 5 6 があり、4 を選択した場合、GridView からデータをリロードするときに、4 を赤 1 2 3 4 5 6 で色付けする必要があります。これは私の aspx ファイルです
<asp:Repeater ID="repeaterPaging" runat="server" >
<ItemTemplate>
<asp:LinkButton ID="pagingLinkButton" runat="server"
Text='<%#Eval("Text") +" | " %>'
CommandArgument='<%# Eval("Value") %>'
Enabled='<%# Eval("Enabled")%>'
OnClick="linkButton_Click" ForeColor="White" Font-Bold="True" Font-Underline="false">
</asp:LinkButton>
</ItemTemplate>
「 | 」をどのように配置できるかについての情報を教えていただければ、LinkButton のようになるのは数字だけです。
私の LinkButtonClick メソッド
protected void linkButton_Click(object sender, EventArgs e)
{
//int totalRows = 0;
LinkButton lb = (LinkButton)sender;
lb.Attributes.Add("class", "BlackLnkBtn");
int pageIndex = int.Parse((sender as LinkButton).CommandArgument);
pageIndex -= 1;
gridViewSearchReport.PageIndex = pageIndex;
//gridViewSearchReport.DataSource = EmployeeDataAccessLayer.
// GetEmployees(pageIndex, GridView1.PageSize, out totalRows);
// FetchData(pageIndex);
gridViewSearchReport.DataSource = FetchData(pageIndex+1);
gridViewSearchReport.DataBind();
DatabindRepeater(pageIndex, gridViewSearchReport.PageSize, RowNumber());
CheckButtonsAvailability(pageIndex + 1);
}
そして、このようにページを埋めます
pages.Add(new ListItem(i.ToString(),i.ToString(), i != (pageIndex + 1)));
基本的に、どのページが現在表示されている atm であるかを示したいと思います。
前もって感謝します。