客户端脚本吧/
http://msdn.microsoft.com/library/en-us/dndude/html/tableedit.asp
http://fason.nease.net/zhuanti/table/sort.htm要不就派生一个DataGrid或重写一个Grid!

解决方案 »

  1.   

    使用模板列,加入TextBox,看看书先
      

  2.   

    请问alf7927(卓不凡)先生:   我设置这样一个模版列textbox里面的值怎么取到啊?
      

  3.   

    Editing with the ASP.NET DataGridhttp://www.aspnextgen.com/printtutorial.aspx?tutorialid=37
      

  4.   

    http://www.aspnextgen.com/Tutorial/ShowContent.aspx?cg=588CE05B-8F08-4D01-83F1-A6DAAF153230&ForumID=4151
      

  5.   

    加入“编辑,更新”按钮列,将其他不需要修改的列改为“只读”,这样就可只修改某行的该列了。EditCommand事件:
           void DataGrid_EditCommand(Object sender, DataGridCommandEventArgs e)
           {
                 ItemsGrid.EditItemIndex = e.Item.ItemIndex;
                 BindGrid();
            }
    最后通过UpdateCommand事件进行更新。
      

  6.   

    使用以下语句:
    this.DataGrid1.Items[i].Cells[j].Text="内容";
    即可。
      

  7.   

    string PropId = ((TextBox)E.Item.Cells[3].Controls[0]).Text; 
    这个就是取里面的内容
      

  8.   

    TextBox里的值是在页面上输入的,这样根本的不到里面的值。
      

  9.   

    datagrid_editcommand(sender as object,e as datagridcommandeventargs)grdpo.edititemindex=e.item.itemindex
        bindgrid()
    end sub
    <asp:id="mydatagrid" runat="server">
    <columns><asp:editcommandcolumn edittext="edit" canceledit="cancel" updatetext="update"/>
    <asp:boundcolumn将其字段设置为只读/>
    </columns>
    </asp>
    不是很详细,自己多看点书先!
      

  10.   

    string st=this.DataGrid1.Items[i].Cells[j].Text.Trim();
      

  11.   

    我是一个新手,我也遇到过这种情况,renzhaxu(renzhaxu)你的取法可以,但是取出来的只是在这个单元格没有更改是的值
      

  12.   

    void DataGrid_EditCommand(Object sender, DataGridCommandEventArgs e)
           {
                 ItemsGrid.EditItemIndex = e.Item.ItemIndex;
                 BindGrid();
            }
    void DataGrid_UpDateCommand(Object sender, DataGridCommandEventArgs e)
    {
      System.Web.UI.WebControl.TextBox tb1=(TextBox)this.DataGrid1.Item[i].Cells  
                                       [j].FindControls("textbox1");
      string st=tb1.Text.Trim();
    }
    sorry!麻烦你自己测试!