日期:2014-05-18  浏览次数:20558 次

GridView控件怎么调整表格大小
GridView控件怎么调整表格大小


怎么设置指定表格的宽和高

------解决方案--------------------
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" CausesValidation="false" Height="80px" Width="200px" CommandName="Delete" Text="删除"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
------解决方案--------------------
如果只是静态设置,楼上已经说了。
我发现一个组件,能实现动态拖动,即可以类似WinForm那样。
http://www.51aspx.com/CV/GridViewPageable/
------解决方案--------------------
也可以在出现的三角弹出的下拉列表中选择编辑列,在选中的字段中选中选择,编辑和删除在他的属性中调整它的宽和高。
------解决方案--------------------
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
for (int i = 0; i = e.Row.Cells.Count; i++)
{
e.Row.Cells[i].Width = Unit.Pixel(100);
e.Row.Cells[i].Height = uint.Parse(22);
}
}