From my Controler class am opening a form1 having a DataGridView using ShowDialog() function
frmOrderCodeResult objfrmOrderCodeResult = new frmOrderCodeResult();
DialogResult dr = new DialogResult();
dr = objfrmOrderCodeResult.ShowDialog(frmMain.SingletonReference);
if (dr == DialogResult.OK)
{
OrderCodeModel objOrderCodeModel = new OrderCodeModel();
Load(objOrderCodeModel);
}
else if (dr == DialogResult.Cancel)
{
return;
}
form1 is having one OK button attached to DialogResult.OK and Cancel button attached to DialogResult.Cancel event and having a daga grid
Once code ran, it will open the dialog and waiting for my OK or Cancel response from dialog.
i have 2 requirements
1. if user select an item from grid and click on ok, it will continue to execute the below code in the controller as shown
dr = objfrmOrderCodeResult.ShowDialog(frmMain.SingletonReference);
if (dr == DialogResult.OK)
. . .
. . .
2. user can double click the row, then also i need to continue to execute from the the same controller code
so i need to attach datagrid item double click event to DialogResult.OK and close my dialog.
Anybody faced similar requirement ? waiting for your valuable response with code block