private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.gridView1.FocusedRowHandle >= 0) { FrmAddPopu frm = new FrmAddPopu(); frm.Text = "修改记录"; frm.ProjectID = ProjectID; frm.ParentID = this.gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "ID").ToString(); Ps_Table_AreaData obj = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as Ps_Table_AreaData; frm.Object = obj; if (frm.ShowDialog() == DialogResult.OK) { frm.Close(); InitGrid1(); } } else { MessageBox.Show("请先选择一条记录", "修改", MessageBoxButtons.OK); } }