Solved

Detect row of a textbox inside a gridview

Posted on 2007-11-29
1
368 Views
Last Modified: 2013-11-07
I have a gridview, the first templatefield column of which is a hyperlink followed by several columns containing textboxes. If I Make a change in any textbox, I can detect the changed value via the textbox's OnTextChanged event, but I need to detect which row of the gridview the changed textbox is in so I can use it to get the corresponding data from the row's link.
0
Comment
Question by:CaptCredence
1 Comment
 
LVL 10

Accepted Solution

by:
digitalZo earned 250 total points
ID: 20380090
Source: http://www.wherecanibuyit.co.uk/ASP/fully_editable_gridview.html
protected void TextBox_TextChanged(object sender, EventArgs e)

{

TextBox thisTextBox = (TextBox)sender;

GridViewRow thisGridViewRow = (GridViewRow)thisTextBox.Parent.Parent;

int row = thisGridViewRow.RowIndex;

rowChanged[row] = true;

}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now