62,254
社区成员
发帖
与我相关
我的任务
分享
<asp:GridView ID="GVPublish" runat="server" CssClass="GridViewStyle" AutoGenerateColumns="False" Width="100%" EmptyDataText='<p style="text-align: center"><span style="color: #ff6600">*无数据*</span></p>' AllowPaging="True" OnPageIndexChanging="GVPublish_PageIndexChanging" PageSize="2" OnRowCommand="GVPublish_RowCommand" >
<FooterStyle CssClass="GridViewFooterStyle" />
<RowStyle CssClass="GridViewRowStyle" />
<SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
<AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
<HeaderStyle CssClass="GridViewHeaderStyle" />
<Columns>
<asp:BoundField DataField="Title" HeaderText="标题" />
<asp:BoundField DataField="ColumnID" HeaderText="所属栏目" />
<asp:TemplateField HeaderText="编辑">
<HeaderStyle Width="40px" />
<ItemTemplate>
<asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/Images/btpaste.gif" CommandName="btnEdit" CommandArgument='<%#DataBinder.Eval(Container,"DataItem.InfoID") %>'
/>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="40px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="删除">
<HeaderStyle Width="40px" />
<ItemTemplate>
<asp:ImageButton ID="btnDelete" runat="server" CommandName="btnDel" CommandArgument='<%#DataBinder.Eval(Container,"DataItem.InfoID") %>'
ImageUrl="~/Images/btdelete.gif" OnClientClick="return confirm('是否确定删除此文章?')" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="40px" />
</asp:TemplateField>
</Columns>
<PagerTemplate>
<asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1) + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
<asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>
<asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton>
<asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton>
<asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton>
<br />
</PagerTemplate>
</asp:GridView>



.GridViewStyle
{
border-right: 1px solid #798a9c;
border-bottom: 1px solid #798a9c;
border-left: 1px solid #798a9c;
border-top: 1px solid #798a9c;
padding: 4px;
}
/* .GridViewStyle a
{
color: #FFFFFF;
}*/
.GridViewHeaderStyle th
{
border-left: 1px solid #EBE9ED;
border-right: 1px solid #EBE9ED;
}
.GridViewHeaderStyle
{
background-image:url('../Images/gridview_header.gif');
background-repeat:repeat-x;
font-weight: bold;
color: black;
height:20px;
}
.GridViewFooterStyle
{
background-color: #5D7B9D;
font-weight: bold;
color: White;
}
.GridViewRowStyle
{
background-color: #F7F6F3;
color: black;
}
.GridViewAlternatingRowStyle
{
background-color: #FFFFFF;
color: balck;
}
.GridViewRowStyle td, .GridViewAlternatingRowStyle td
{
border: 1px solid #EBE9ED;
}
.GridViewSelectedRowStyle
{
background-color: #E2DED6;
font-weight: bold;
color: #333333;
}
.GridViewPagerStyle
{
background-color: #284775;
color: #FFFFFF;
}
.GridViewPagerStyle table /**//* to center the paging links*/
{
margin: 0 auto 0 auto;
}