怎么让GridView分页时,出现上条记录和下一条记录的标题?

来源:百度知道 编辑:UC知道 时间:2024/06/27 17:51:04
此代码只显示上下页的箭头. 如果要用到后台代码,怎么简单实现?
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1"
PageSize="1">
<PagerSettings Mode="NextPreviousFirstLast" />
<Columns>
<asp:BoundField DataField="content" HeaderText="content"
SortExpression="content" />
<asp:BoundField DataField="author" HeaderText="author"
SortExpression="author" />
<asp:BoundField DataField="time" HeaderText="time" SortExpression="time" />
<asp:BoundField DataField="company" HeaderText="company"

选择数据源之后,上面会出现“启动分页”的功能,打上勾就可以了!

旁边有个小三角形。里面有编辑列,选一个你需要改的标题,
找到HeaderText 旁边写的内容就是你的标题名字