ultragrid在删除行的问题

guanzg 2007-06-14 10:32:39
选择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();
}
...全文
360 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hgs5945 2007-09-28
  • 打赏
  • 举报
回复
把this.ugrid_edu.Rows[i].Delete();
改为this.ugrid_edu.Rows[i].Delete(false);

zhulei2008 2007-06-14
  • 打赏
  • 举报
回复
ultragrid??
没用过。
guanzg 2007-06-14
  • 打赏
  • 举报
回复
没人知道么
guanzg 2007-06-14
  • 打赏
  • 举报
回复
呵呵,搞定了

this.ugrid_edu.Rows[i].Delete();
改为
this.ugrid_edu.Rows[i].Delete(false);
就ok了

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧