我是这样写的:
public void del(object sender,DataGridCommandEventArgs objArgs )
{
string strconn="provider=microsoft.jet.oledb.4.0;Data Source="+Request.PhysicalApplicationPath+"database\\docdata.mdb";
if(objArgs.CommandName=="delete")
{
int group_id=int.Parse(objArgs.Item.Cells[0].Text);
delu objDelu=new delu();
objDelu.delug(strconn,group_id);
}
BindDataGrid()
}
public void BindDataGrid()
{
string constr="provider=microsoft.jet.oledb.4.0;Data Source="+Request.PhysicalApplicationPath+"database\\docdata.mdb";
            DataSet objDataSet;
sug objsug=new sug();
objDataSet=objsug.ugDataSet(constr);
if(objDataSet==null)
return;
MyDataGrid.DataSource=objDataSet;
MyDataGrid.DataBind();
}
但还是不行呀

解决方案 »

  1.   

    在你的page_load里面也应该BinddataGrid();
      

  2.   

    删除完重新邦定一下datagrid就可以了
      

  3.   

    你添加,删除后,使用代码修改DATAGRID中的内容就可以了。
      

  4.   

    删除完重新邦定一下datagrid就可以了
      

  5.   

    那你重新定位一下本页面,不久行了吗。
    page_load
    {
    ...
    BindDataGrid();
    ...
    }
    ...
    public void del(object sender,DataGridCommandEventArgs objArgs )
    {
    Response.Redirect("本页");
    }
      

  6.   

    page_load
    {
      if (!IsPostBack)
      {
    ...
        BindDataGrid();...
      }
    }
    删除后要重新绑定