1
Answer

How to delete / edit a row in gridview dynamically

kumartyr

kumartyr

10y
894
1
How to delete or edit a row in gridview dynamically with the delete/edit button present in the columns of gridview itself

please see the image for understanding

i have tried rowdeleting event for deleting & rowediting for edit but no use

using VS2005 asp.net C# 2.0

below is what i tried in rowdeleting event
protected void GridViewFRM_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (connection.State == ConnectionState.Closed)
{
connection.Open();
}
OracleCommand OLCOM3 = new OracleCommand();
OLCOM3.CommandText = "Delete from FORUM WHERE QUESTION='" + GridViewFRM.DataKeys[e.RowIndex].Values[0].ToString() + "'";
OLCOM3.ExecuteNonQuery();
DisplayUserData(); }

Attachment: picture.zip

Answers (1)