How to add a textbox and button inside gridview..
i fetch data from database which contain 3 columns ProductName,ProId and Price.Price will be show inside textbox.if Price is empty in text box then we can enter price using add button or update it..
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Khargesh RajputRank #616 · 3.9K reputationPosted Feb 9, 2015, 5:54 PM EST
protected void btnSave_OnClick(object sender, EventArgs e)
{
Button lb = (Button)sender;
GridViewRow row = (GridViewRow)lb.NamingContainer;
if (row != null) { int index = row.RowIndex; //gets the row index selected TextBox tb = (TextBox)GridView1.Rows[index].FindControl("TextBox2");
//code to update data
}
}
keyurRank #5,481 · 298 reputationPosted Feb 9, 2015, 6:19 PM EST
Please go through the below link may be it will help yo to resolve your problems
http://www.c-sharpcorner.com/UploadFile/9f0ae2/gridview-edit-delete-and-update-in-Asp-Net/
thanks
Keyur
Munesh SharmaRank #174 · 13.9K reputationPosted Feb 13, 2015, 11:40 PM EST