浏览状态下的列宽度可以这样设置:
Column.ItemStyle.Width = 100;

编辑状态下的列宽度可以这样设置:
private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    DataGridItem line = dbgCustomers.Items[e.Item.ItemIndex];
    TextBox tb1 = (TextBox)line.Cells[0].Controls[0];
    TextBox tb2 = (TextBox)line.Cells[1].Controls[0];

    tb1.Width = Unit.Percentage(100);
    tb2.Width = Unit.Percentage(100);
    tb2.TextMode = TextBoxMode.MultiLine;
}

参见:
http://msmvps.com/montaque/posts/5353.aspx

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案