Adding a paramter to a new eventhandler
Hello i am creating a dynamic gridview and there is a part that i create a
new eventhandler for edits. I also create a new method for doing the
actual edit, but i need to pass it a datatable name as one of the
parameters so i can rebind it. I can't figure out where to add that
paramter:
GridView gridData = new GridView();
gridData.ID = "test";
gridData.AutoGenerateEditButton = true;
gridData.RowEditing += new GridViewEditEventHandler(grid_RowEditing);
gridData.DataSource = tbl;
gridData.DataBind();
protected void grid_RowEditing(object sender, GridViewEditEventArgs e)
{
((GridView)sender).EditIndex = e.NewEditIndex;
// I don't know how to pass the datasource name to this method, or
if its even possible, because i won't ever know the actual
gridview name because its dynamically created
//((GridView)sender).DataSource = ;
((GridView)sender).DataBind();
No comments:
Post a Comment