Hi guys, I'm trying to give the possibility to a user to disable some event of a datagrid.
When an event is associated to a function in design time a line like that must be added to code:
this.dg.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dg_EditCommand);
to remove the handler we must do
this.dg.EditCommand -= new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dg_EditCommand);
The problem is: I would like to make a function in the page load that generically disable the events of a generical datagrid on the page.
I thougth to remove the eventhandler so I can
this.findcontrol(nameofthedatagrid).editcommand -= new System.Web.UI.WebControls.DataGridCommandEventHandler(???what???)
I don't know the name of the function added to eventhandler, how I can retrieve it?
I hope to have explained well the problem, maybe there's some other way to disable the event, the main thing is that it should be generical, in order to place it into a class from which deriving every webform.
Thank in advance
Stevie B. Gibson
When an event is associated to a function in design time a line like that must be added to code:
this.dg.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dg_EditCommand);
to remove the handler we must do
this.dg.EditCommand -= new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dg_EditCommand);
The problem is: I would like to make a function in the page load that generically disable the events of a generical datagrid on the page.
I thougth to remove the eventhandler so I can
this.findcontrol(nameofthedatagrid).editcommand -= new System.Web.UI.WebControls.DataGridCommandEventHandler(???what???)
I don't know the name of the function added to eventhandler, how I can retrieve it?
I hope to have explained well the problem, maybe there's some other way to disable the event, the main thing is that it should be generical, in order to place it into a class from which deriving every webform.
Thank in advance
Stevie B. Gibson