P
PeterZ
Hi,
I have a single context menu assigned to 10 controls (DataGrids) on a form.
In the context menu item click event I need to determine which control
(DataGrid) is invoking this menu item. Something like this:
private void cmnuItem1_Click(object sender, System.EventArgs e)
{
string sInvokingControlName = ..... which DataGrid invoked the context
menu .....
switch(sInvokingControlName)
{
case "DataGrid1"
.... run some operation on datagrid 1
break;
case "DataGrid2"
.... run some operation on datagrid 2
break;
case "DataGrid3"
.... run some operation on datagrid 3
break;
}
}
Any suggestions how I could achieve this?
Thanks,
PeterZ
I have a single context menu assigned to 10 controls (DataGrids) on a form.
In the context menu item click event I need to determine which control
(DataGrid) is invoking this menu item. Something like this:
private void cmnuItem1_Click(object sender, System.EventArgs e)
{
string sInvokingControlName = ..... which DataGrid invoked the context
menu .....
switch(sInvokingControlName)
{
case "DataGrid1"
.... run some operation on datagrid 1
break;
case "DataGrid2"
.... run some operation on datagrid 2
break;
case "DataGrid3"
.... run some operation on datagrid 3
break;
}
}
Any suggestions how I could achieve this?
Thanks,
PeterZ