I have a gridview I want that when I click on "edit" button in gridview then edit row values inserted in the controls which is outside the gridview and then row is deleted. Can I call "delete" event method inside the "edit" event, because I want to first retrieve values in controls and then row is deleted.
Here is my aspx.cs code. Both delete and edit event code here :
protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DataTable t = (DataTable)Session["MyDataTable"];
t.Rows.RemoveAt(e.RowIndex);
GridView2.DataSource = t;
GridView2.DataBind();
}
public void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
{
DataTable t = (DataTable)Session["MyDataTable"];
TextBox1.Text=GridView2.Rows[e.NewEditIndex].Cells[1].Text.ToString();
DropDownList1.Text = GridView2.Rows[e.NewEditIndex].Cells[2].Text.ToString();
GridView2.EditIndex = -1;
GridView2.DataSource = t;
GridView2.DataBind();
//CAN I CALL GRIDVIEW_ROW_DELETING method here? I try but problem is arguments etc
}