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 3381 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:
Sexy Web Design - Free 71 Page Preview!
An easy-to-follow guide that reveals the secrets of how to build your own breathtaking web interfaces from scratch.
Introduction to Web Applications Development
This 376 page eBook "Introduction to Web Applications Development", starts with an introduction to the internet, including a brief history of the TCT/IP protocol and World Wide Web.
100% Free Subscription until Stock lost.View complete list.
Sponsored by