private void gridViewBank_DoubleClick(object sender, EventArgs e) { Model.Bank bank = gridUtility1.GetSelectedItem <Model.Bank>(); if (bank == null) { return; } frmEditBankUpdate obj = new frmEditBankUpdate(bank); obj.updateBank = InsertOrUpdate; obj.ShowDialog(); }
private void treeList1_DoubleClick(object sender, EventArgs e) { TreeList tree = sender as TreeList; TreeListHitInfo hi = tree.CalcHitInfo(tree.PointToClient(Control.MousePosition)); if (hi.Node != null) { TreeListNode node = treeList1.Selection[0]; if (node.Tag.ToString() == "Parent") //is Parent (BANK) { frmEditBankUpdate obj1 = new frmEditBankUpdate(getBankRecord(node)); obj1.updateBank = InsertOrUpdate; obj1.ShowDialog(); } else //is Child (Branch) { BrankBank bran = getBranchBankRecord(node); frmEditBranchBankUpdate obj2 = new frmEditBranchBankUpdate(bran); obj2.updateBranch = InsertOrUpdate; obj2.ShowDialog(); } } }