private void bt_Del_Click(object sender, EventArgs e) { if (this.gridView1.RowCount < 1 || this.gridView1.FocusedRowHandle < 0) { return; } int _index = this.gridView1.FocusedRowHandle; DataRow _dr = this.gridView1.GetDataRow(_index); string _delid = _dr["ID"].ToString(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { if (_msc.DelSavedQuery(_delid)) { XtraMessageBox.Show("删除成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.gridView1.DeleteRow(_index); } } }