I have a form that has a function, HandleCellButtonClick, that I hook up to an event
buttonColumn.CellButtonClicked +=
new CustomGridColumns.DataGridCellButtonClickEventHandler(HandleCellButtonClick);
That works fine HandleCellButtonClick has the signature of DataGridCellButtonClickEventHandler
Where this all goes wrong is if I take the code out of the form and put it in a controller class so that the function looks something like this
public static SetGrid(DataTable dt, DataGrid dg, (???) dHandleClick)
{
.
.
.
buttonColumn.CellButtonClicked +=
new CustomGridColumns.DataGridCellButtonClickEventHandler(dHandleClick);
}
What type of variable do I name the last Parameter so I can make the call
Controller.SetupGrid(dtCustomer, dgCustomer, HandleCellButtonClick);
Thus hooking up the function on the form to the event of a grid column.
I tried void(object, DataGridCellButtonClickEventHandler), the reason I choose this route is in the intella-sense of other eventhandlers you will see "void(object, EventArgs) target" as the parameter type, but the compiler does not like void() as a type.
buttonColumn.CellButtonClicked +=
new CustomGridColumns.DataGridCellButtonClickEventHandler(HandleCellButtonClick);
That works fine HandleCellButtonClick has the signature of DataGridCellButtonClickEventHandler
Where this all goes wrong is if I take the code out of the form and put it in a controller class so that the function looks something like this
public static SetGrid(DataTable dt, DataGrid dg, (???) dHandleClick)
{
.
.
.
buttonColumn.CellButtonClicked +=
new CustomGridColumns.DataGridCellButtonClickEventHandler(dHandleClick);
}
What type of variable do I name the last Parameter so I can make the call
Controller.SetupGrid(dtCustomer, dgCustomer, HandleCellButtonClick);
Thus hooking up the function on the form to the event of a grid column.
I tried void(object, DataGridCellButtonClickEventHandler), the reason I choose this route is in the intella-sense of other eventhandlers you will see "void(object, EventArgs) target" as the parameter type, but the compiler does not like void() as a type.