刷新了,或者回滚了,并且是重新联结了大DataSet,不知道为什么?急呀!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

解决方案 »

  1.   

    行指针还在被删除的行上,重新设置currentcell
      

  2.   

    也重新绑定了DataSet,你们是怎么删除的,删除之后是怎么刷新的,请赐教,分不够在加
      

  3.   

    哥们,估计你是没有刷新dategrid。你重新帮定一次,我的做法是
    清空dataset,重新fill,在banding
      

  4.   

    我的代码是
    删除:if (MessageBox.Show("确定要删除此条记录.","信息",MessageBoxButtons.OKCancel,MessageBoxIcon.Information)==DialogResult.OK )
    {
    DataRow[] thisRow=dataSet11.Tables["EMSFMGZGLZ"].Select();

    sqlConnection1.Close();
    sqlConnection1.Open();
    string sql="delete from emsfmgzglz where bdzt='"+textBox10.Text.Trim()+"' and gzbdbm='"+textBox9.Text.Trim()+"'";
    SqlCommand myCommand=new SqlCommand(sql,sqlConnection1);
    myCommand.ExecuteNonQuery();
     sql="delete from emsfmgzglc where bdzt='"+textBox10.Text.Trim()+"' and gzbdbm='"+textBox9.Text.Trim()+"'";
    // SqlCommand myCommand=new SqlCommand(sql,sqlConnection1);
    myCommand.ExecuteNonQuery(); Make_Gzglz();
    sqlConnection1.Close();
    dataSet11.AcceptChanges(); } 刷新
    string sql=null;
    sql="select * from EMSFMGZGLZ;select * from EMSFMBMB ";
    sqlDataAdapter1.SelectCommand.CommandText=sql;
    sqlConnection1.Close();
    this.dataSet11.Tables[1].Clear();
    this.sqlDataAdapter1.Fill(dataSet11,0,0,"EMSFMGZGLZ");
      

  5.   

    在删除数据之前把
    DataGrid的SelectIndex置为 -1