<asp:textbox columns="20" maxlength="100" runat="server" />

解决方案 »

  1.   

    maxlength好象只能设置在文本框中输入的字符(Unicode)个数,如果要设置文本框的宽度,可以在该列的模式编辑中,对其的宽度赋值,或者可以在它的角本代码中给出。
      

  2.   

    我是指点击DataGrid中点击编辑后的状态阿??
      

  3.   

    TextBox tb ;
    tb = (TextBox)(DataGrid.Items[0].Cells[0].Controls[0]);
    tb.Width = new Unit(50) ;
    tb.Height = new Unit(50) ;
      

  4.   

    put the textbox in the EditTemplate