<Columns>
//下面是复选款
<asp:TemplateField> <HeaderTemplate> <asp:CheckBox ID="SelAll" runat="server" Text="全选" /> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="Sel" runat="server" /> </ItemTemplate> </asp:TemplateField>//下面是绑定数据源 <asp:BoundField DataField="VirPostTitel" HeaderText="标题"/> <asp:BoundField DataField="VirPostContent" HeaderText="内容"/> <asp:BoundField DataField="VirUserName" HeaderText="作者"/> <asp:BoundField DataField="VirPublishedTime" HeaderText="时间"/></Columns>
//下面是分页设置
<PagerTemplate> <asp:LinkButton ID="LinkButtonFirstPage" runat="server" CommandArgument="First" CommandName="Page" Visible='True' CSSClass="pTemplate">首页</asp:LinkButton> <asp:LinkButton ID="LinkButtonPReviousPage" runat="server" CommandArgument="Prev" CommandName="Page" Visible='True' CssClass="pTemplate" >上一页</asp:LinkButton> <asp:LinkButton ID="LinkButtonNextPage" runat="server" CommandArgument="Next" CommandName="Page" Visible='True' CssClass="pTemplate">下一页</asp:LinkButton> <asp:LinkButton ID="LinkButtonLastPage" runat="server" CommandArgument="Last" CommandName="Page" Visible='True' CssClass="pTemplate">尾页</asp:LinkButton> 当前第: <asp:Label ID="LabelCurrentPage1" runat="server" Text="<%# ((GridView)Container.NamingContainer).PageIndex + 1 %>" CssClass="LabelCurrentPage1" ClientIDMode="Static"></asp:Label> 页/共: <asp:Label ID="LabelPageCount" runat="server" Text="<%# ((GridView)Container.NamingContainer).PageCount %>"></asp:Label> 页 </PagerTemplate> </asp:GridView>新闻热点
疑难解答