ultragrid在删除行的问题
选择ultragrid一行进行删除时,该控件会自动弹出一个对话框,问是否删除,我不想用这个,我要用自己定义的,要怎么把自带的对话框禁用掉?
try
{
if (MessageBox.Show("正在删除您选中的一条记录,是否要删除?", "删除记录", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
int i = rowindex;
string id = this.ugrid_edu.Rows[i].Cells[0].Text;
this.ugrid_edu.Rows[i].Delete();
this.oleConnection.Open();
this.oleDbDataAdapter1.DeleteCommand.CommandText = "delete from t_edu where id=@id";
this.oleDbDataAdapter1.DeleteCommand.Parameters["@id"].Value = Convert.ToInt32(id.ToString());
this.oleDbDataAdapter1.DeleteCommand.CommandType = CommandType.Text;
this.oleDbDataAdapter1.DeleteCommand.ExecuteNonQuery();
MessageBox.Show("ok", "ok", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception err)
{
MessageBox.Show(err.Message.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
this.oleConnection.Close();
}