<asp:GridView ID="gvGuquanrongzi" runat="server" AutoGenerateColumns="False"
CaptionAlign="Top" Height="206px" Width="475px" RowStyle-Height="30" >
<Columns>
<asp:HyperLinkField DataTextField="Mingcheng" HeaderText="项目名称" >
<HeaderStyle Height="26px" Width="214px" />
<ItemStyle Height="30px" Width="214px" />
</asp:HyperLinkField>
<asp:BoundField DataField="Qiyemingcheng" HeaderText="公司简称" >
<HeaderStyle Height="26px" Width="55px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
<asp:BoundField DataField="Code_name" HeaderText="所属行业" >
<HeaderStyle Height="26px" Width="56px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
<asp:BoundField DataField="Rongziedu" HeaderText="融资金额" >
<HeaderStyle Height="26px" Width="57px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
<asp:BoundField DataField="Faburiqi" HeaderText="申请日期" >
<HeaderStyle Height="26px" Width="75px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
</Columns>
</asp:GridView>
上面是我gridview 的代码,我想把行高 列宽 固定死,怎么实现 gridview不会随数据的长短二变化,要怎么实现,是否用datalist比较好?没用过,请教大家
CaptionAlign="Top" Height="206px" Width="475px" RowStyle-Height="30" >
<Columns>
<asp:HyperLinkField DataTextField="Mingcheng" HeaderText="项目名称" >
<HeaderStyle Height="26px" Width="214px" />
<ItemStyle Height="30px" Width="214px" />
</asp:HyperLinkField>
<asp:BoundField DataField="Qiyemingcheng" HeaderText="公司简称" >
<HeaderStyle Height="26px" Width="55px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
<asp:BoundField DataField="Code_name" HeaderText="所属行业" >
<HeaderStyle Height="26px" Width="56px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
<asp:BoundField DataField="Rongziedu" HeaderText="融资金额" >
<HeaderStyle Height="26px" Width="57px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
<asp:BoundField DataField="Faburiqi" HeaderText="申请日期" >
<HeaderStyle Height="26px" Width="75px" />
<ItemStyle Height="30px" Width="214px" />
</asp:BoundField>
</Columns>
</asp:GridView>
上面是我gridview 的代码,我想把行高 列宽 固定死,怎么实现 gridview不会随数据的长短二变化,要怎么实现,是否用datalist比较好?没用过,请教大家
css控制
<dx:GridViewDataTextColumn FieldName="Code" VisibleIndex="1"
ShowInCustomizationForm="True" Width="200px">
例如:this.GridView1.HeaderRow.Cells[0].Width = 500;