G
Guest
Hello EveryBody,
How can i assign dynamically the DataGridCommandEventHandler to a
dynamically created link buttons command property.
as i have been trying to do the following
in the ItemDataBound event of the datagrid , I am dynamically creating a
link button and assigning the command property with
DataGridCommandEventHandler ,like below:
LinkButton lButton=new LinkButton();
lButton.Text ="Add Details";
lButton.ID ="flagbutton";
lButton.CommandName="changeFlag";
lButton.Command +=new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.HighRevenuePaxDg_ItemCommand);
//where HighRevenuePaxDg is the datagrid.
I am trying to add the itemcommand event handler of the datagrid, so that
the click of the link button should invoke the event
"HighRevenuePaxDg_ItemCommand".
But i am getting a compile time error at the place where i am assigning the
event to the command property of the link button
lButton.Command +=new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.HighRevenuePaxDg_ItemCommand);
Error:
Cannot implicitly convert type
'System.Web.UI.WebControls.DataGridCommandEventHandler' to
'System.Web.UI.WebControls.CommandEventHandler'
so could anyone of you help me out in solving the problem and also telling
me the cause of the problem.
your expert advice would be highly appreciated.
Rgds
Shiju
How can i assign dynamically the DataGridCommandEventHandler to a
dynamically created link buttons command property.
as i have been trying to do the following
in the ItemDataBound event of the datagrid , I am dynamically creating a
link button and assigning the command property with
DataGridCommandEventHandler ,like below:
LinkButton lButton=new LinkButton();
lButton.Text ="Add Details";
lButton.ID ="flagbutton";
lButton.CommandName="changeFlag";
lButton.Command +=new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.HighRevenuePaxDg_ItemCommand);
//where HighRevenuePaxDg is the datagrid.
I am trying to add the itemcommand event handler of the datagrid, so that
the click of the link button should invoke the event
"HighRevenuePaxDg_ItemCommand".
But i am getting a compile time error at the place where i am assigning the
event to the command property of the link button
lButton.Command +=new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.HighRevenuePaxDg_ItemCommand);
Error:
Cannot implicitly convert type
'System.Web.UI.WebControls.DataGridCommandEventHandler' to
'System.Web.UI.WebControls.CommandEventHandler'
so could anyone of you help me out in solving the problem and also telling
me the cause of the problem.
your expert advice would be highly appreciated.
Rgds
Shiju