J
Jonas Karlsson
The following code gives a compile error:
Method myGrid_Edit(object,
System.Web.UI.WebControls.DataGridCommandEventArgs)' does not match delegate
'void System.EventHandler(object, System.EventArgs)'
When I change my eventhandler to instead of the DataGridCommandEventArgs
takes the EventArgs I get:
Cannot implicitly convert type 'System.EventHandler' to
'System.Web.UI.WebControls.DataGridCommandEventHandler'
My code:
DataGrid myGrid = new DataGrid();
myGrid.EditCommand += new EventHandler(myGrid_Edit);
public void myGrid_Edit(Object sender, DataGridCommandEventArgs e)
{
myGrid.EditItemIndex = e.Item.ItemIndex;
myGrid.DataBind();
}
Method myGrid_Edit(object,
System.Web.UI.WebControls.DataGridCommandEventArgs)' does not match delegate
'void System.EventHandler(object, System.EventArgs)'
When I change my eventhandler to instead of the DataGridCommandEventArgs
takes the EventArgs I get:
Cannot implicitly convert type 'System.EventHandler' to
'System.Web.UI.WebControls.DataGridCommandEventHandler'
My code:
DataGrid myGrid = new DataGrid();
myGrid.EditCommand += new EventHandler(myGrid_Edit);
public void myGrid_Edit(Object sender, DataGridCommandEventArgs e)
{
myGrid.EditItemIndex = e.Item.ItemIndex;
myGrid.DataBind();
}