I am creating a dynamic gridview and there is a part that I create a new event handler 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 parameter:
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();