日期:2014-05-17  浏览次数:20372 次

GridView如何指定显示字段个数?谢谢赐教!
GridView如何指定显示字段个数?谢谢赐教!

我写了如下代码,可是显示时老越界显示其他字段啊 
HTML code

<asp:GridView ID="GridView1" runat="server" Height="100%" Width="100%" CellPadding="4" ForeColor="#333333" GridLines="None" onrowdatabound="GridView1_RowDataBound">
                             <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                             <RowStyle BackColor="#EFF3FB" />
                             <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                             <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                             <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                             <EditRowStyle BackColor="#2461BF" />
                             <AlternatingRowStyle BackColor="White" />
                           <Columns>
                             <asp:BoundField HeaderText="选种" DataField="ischeck" />
                             <asp:BoundField HeaderText="项目编号" DataField="ItemNo" />
                             <asp:BoundField HeaderText="项目名称" DataField="ItemName" />
                             <asp:BoundField HeaderText="工时" DataField="SrvTimes" />
                             <asp:BoundField HeaderText="单价" DataField="Price" />      
                             <asp:BoundField HeaderText="系统类别" DataField="systemtype" />
                             <asp:BoundField HeaderText="金额" DataField="Amount" />
                             <asp:BoundField HeaderText="保养类别" DataField="bytypeno" />
                           </Columns>
                        

                         </asp:GridView>



------解决方案--------------------
AutoGenerateColumns=“False"