private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e) { try { int parentId = int.Parse(this.tl_dict.FocusedNode.GetValue("ID").ToString()); string parentName = this.tl_dict.FocusedNode.GetValue("MenuName").ToString(); var frm = new BasicDetail { parentId = parentId, parentName = parentName, id = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Id")), name = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Name").ToString() }; if (DialogResult.OK == frm.ShowDialog()) { tl_dict_FocusedNodeChanged(null, null); } else { XtraMessageBox.Show("编辑失败!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { XtraMessageBox.Show("编辑出错!" + ex.Message); } }
private void btn_Add_Click(object sender, EventArgs e) { try { int parentId = int.Parse(this.tl_dict.FocusedNode.GetValue("ID").ToString()); string parentName = this.tl_dict.FocusedNode.GetValue("MenuName").ToString(); if (parentId > 0) { var frm = new BasicDetail { parentId = parentId, parentName = parentName }; if (DialogResult.OK == frm.ShowDialog()) { tl_dict_FocusedNodeChanged(null, null); } } } catch (Exception) { throw; } }