AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 How to find controls inside EditItemTemplate section from GridView RowDataBound event?
Posted by Moderator1 on  9/25/2010 11:06:18 PM 13314 Views
It’s easy to find a control placed inside GridView ItemTemplate section in RowDataBound event. But it’s bit hard to find the controls inside the EditItemTemplate section. Here we are going to show a small piece of code to achieve it.

In the RowDataBound event, add the below code to find the control in EditItemTemplate section.

private void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if ((e.Row.RowState & DataControlRowState.Edit)) {
TextBox TextBox1 = new TextBox();
TextBox1 = e.Row.FindControl("TextBox1");
Response.Write(TextBox1.Text);
}
}

Post New Tips/Tricks View all Tips/Tricks

Featured Resources:
Simply JavaScript - Free 150 Page Preview!
Packed with full-color examples, Simply JavaScript is all you need to start programming in JavaScript the right way.
Simply SQL - Free 111 Page Preview!
Simply SQL is a practical step-by-step guide to writing SQL.
100% Free Subscription until Stock lost.View complete list.
Sponsored by