当前位置: 代码迷 >> ASP.NET >> DataGrid绑定时DataView时,DataView.Count()为237或259行,为什么绑定后,界面上一直只有24行?解决方法
  详细解决方案

DataGrid绑定时DataView时,DataView.Count()为237或259行,为什么绑定后,界面上一直只有24行?解决方法

热度:4428   发布时间:2013-02-25 00:00:00.0
DataGrid绑定时DataView时,DataView.Count()为237或259行,为什么绑定后,界面上一直只有24行?
<div   id= "DivWxPO "   style= "BORDER-RIGHT:   #3a81c8   1px   solid;   BORDER-TOP:   #3a81c8   1px   solid;   OVERFLOW:   auto;   BORDER-LEFT:   #3a81c8   1px   solid;   WIDTH:   700px;   BORDER-BOTTOM:   #3a81c8   1px   solid;   HEIGHT:   300px "
runat= "server "> <asp:datagrid   id= "Dg_WxPO "   runat= "server "   AutoGenerateColumns= "False "   AllowPaging= "True "   PageSize= "25 "
HeaderStyle-CssClass= "MyStyle "   FooterStyle-CssClass= "MyStyle "   BackColor= "#DDEBFF "   BorderWidth= "0px "   bordercolor= "#3a81c8 "
width= "100% "   GridLines= "None ">
<ItemStyle   HorizontalAlign= "Left "   Height= "26px "> </ItemStyle>
<HeaderStyle   Font-Bold= "True "   HorizontalAlign= "Center "   ForeColor= "White "> </HeaderStyle>
<Columns>
<asp:BoundColumn   DataField= "po_num "   HeaderText= "采购单单号 "   ItemStyle-HorizontalAlign= "Center "> </asp:BoundColumn>
<asp:BoundColumn   DataField= "order_date "   HeaderText= "采购日期 "   ItemStyle-HorizontalAlign= "Center "> </asp:BoundColumn>
<asp:BoundColumn   DataField= "buyerName "   HeaderText= "采购员 "   ItemStyle-HorizontalAlign= "Center "> </asp:BoundColumn>
<asp:BoundColumn   DataField= "po_cost "   HeaderText= "金额 "   ItemStyle-HorizontalAlign= "Center "> </asp:BoundColumn>
<asp:BoundColumn   DataField= "curr_code "   HeaderText= "货币 "   ItemStyle-HorizontalAlign= "Center "> </asp:BoundColumn>
<asp:BoundColumn   DataField= "whse "   HeaderText= "仓库 "   ItemStyle-HorizontalAlign= "Center "> </asp:BoundColumn>
</Columns>
<PagerStyle   Visible= "False "   NextPageText= "下一页 "   PrevPageText= "上一页 "> </PagerStyle>
</asp:datagrid> </div>



------解决方案--------------------------------------------------------
你设置了分页显示吧?
------解决方案--------------------------------------------------------
貌似你开了分页显示又隐藏了分页的页码....
------解决方案--------------------------------------------------------
是25行吧 ? PageSize= "25 "

你起动了分页功能,每页只显示25行啊,显示24行,你可能翻到了最后一页

DataView.Count()指的是记录总数
  相关解决方案