private void btOk_Click(object sender, EventArgs e) { for (int i = 0; i < dataGridView.Rows.Count; i++) { CTButtonInView tiv = (CTButtonInView)dataGridView.Rows[i].Tag; tiv.Idx = i; m_View.ViewFilterMgr.Update(tiv); } if (!m_View.Save(true)) { MessageBox.Show("保存失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.DialogResult = DialogResult.OK; this.Close(); }