To Access the details from gridview all row single cell

145 pts.
Tags:
.NET
ASP.NET
ASP.NET 3.5
DataGridView
Hi friends, I have one gridview in which I bindinig data ,in gridview I have four BoundField  and one template field in template field I put Insert Item template which contains Textbox . What is my requrement ? at the submit button click I want access all Textbox value and store into Database. If anybody has solutiuon then please share it ........ Thanks

Software/Hardware used:
ASP.Net
ASKED: March 8, 2011  11:13 AM
UPDATED: August 12, 2011  12:06 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

foreach (GridViewRow gvr in this.GridView1.Rows)
{
//get value from template field,
//5 is the index of your template field
string textboxValue = ((TextBox)gvr.Cells[5].FindControl(“textbox1″)).Text;

//update to db method
}

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following