分页那一行就是不显示 急死我了。。。。。。。。
<asp:GridView ID="GridView1" CssClass="GridViewStyle" Width="900px" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" AllowPaging="True" Font-Size="15px" DataKeyNames="KID" OnRowEditing="GridView1_RowEditing" OnRowCreated="GridView1_RowCreated"><Columns>
<asp:BoundField DataField="KID" HeaderText="KID" SortExpression="KID" />
<asp:BoundField DataField="LID" HeaderText="LID" SortExpression="LID" Visible="False" />
<asp:BoundField DataField="Date" HeaderText="订货日期" SortExpression="Date" DataFormatString="{0:yyyy-M-d}" />
<asp:BoundField DataField="ContractID" HeaderText="合同号" SortExpression="ContractID" />
<asp:BoundField DataField="CustName" HeaderText="订货单位" SortExpression="CustName" />
<asp:BoundField DataField="CustId" HeaderText="CustId" SortExpression="CustId" Visible="False" />
<asp:BoundField DataField="GasCylinderName" HeaderText="气瓶规格" SortExpression="GasCylinderName" />
<asp:BoundField DataField="GNumber" HeaderText="数量" SortExpression="GNumber" />
<asp:BoundField DataField="CollectPrice" HeaderText="实收金额" SortExpression="CollectPrice" />
<asp:BoundField DataField="CompanyName" HeaderText="发货物流名称" SortExpression="CompanyName" />
<asp:BoundField DataField="PracticalPrice" HeaderText="实际金额" SortExpression="PracticalPrice" />
<asp:BoundField DataField="Destination" HeaderText="到站" SortExpression="Destination" />
<asp:BoundField DataField="Purpose" HeaderText="Purpose" SortExpression="Purpose"
Visible="False" />
<asp:BoundField DataField="Remark" HeaderText="备注" SortExpression="Remark" />
<asp:BoundField DataField="GID" HeaderText="GID" SortExpression="GID" Visible="False" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText="修改" ShowEditButton="True" />
<asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
</Columns>
<RowStyle CssClass="RowStyle" />
<PagerStyle CssClass="PagerStyle" />
<SelectedRowStyle CssClass="SelectedRowStyle" />
<HeaderStyle CssClass="HeaderStyle" />
<AlternatingRowStyle CssClass="AltRowStyle" />
</asp:GridView> --------------------编程问答-------------------- 默认分页吗?
默认分页注意分页后绑定
建议还是用AspNetPager
里面有DEMO 自己做个练习就会了。
AspNetPager --------------------编程问答-------------------- 你去Gridview属性中 设置一个叫AllowPaging选项中填“true” 和 叫ShowFooter中都填true的选项
ShowHeader --------------------编程问答-------------------- 你在GridView的分页属性中‘Allowpaging’ 设置为'True'
触发PageIndexChanging这个事件
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
‘绑定数据’;
} --------------------编程问答-------------------- AspNetPager --------------------编程问答-------------------- ObjectDataSource1 的分页设置了么? --------------------编程问答-------------------- 什么都没贴出来,要怎么看你的错误呢
--------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- 自己写个分页 又不是很难 --------------------编程问答-------------------- 学习啊
--------------------编程问答-------------------- Allowpaging
补充:.NET技术 , ASP.NET