能删除一般多可以增加
以前我看过table中用过,但是datagrid我没有用过

解决方案 »

  1.   

    在你绑定的DataTable上NewRow就可以了
      

  2.   

    我是想newrow了,然后绑定到datagrid,再通过datagrid来添加数据,为什么datagrid中没有显示空的新增的那行?
      

  3.   

    private void AddNewRow_Click(object sender, System.Web.UI.ImageClickEventArgs e)
    {
                               ds=(DataSet)Session["ds"];
    ds.Tables["1"].NewRow();
    Session["ds"] = ds ;
    DataGrid1.DataSource=ds;
    DataGrid1.DataBind();
    DataGrid1.EditItemIndex=ds.Tables["1"].Rows.Count-1;
                       }这几句有没有问题?
      

  4.   

    // DataRow row=dt.NewRow();
    // row["ipointcount"]=dt.Compute("sum(ipointcount)","");
    // dt.Rows.Add(row);比如这样就给dt增加了一个合计行