I know using FindControl in ASP.NET is not always as easy as it would seem on the surface. Particularly when you start looking for controls inside of a DataGrid or a Repeater. This article should help out.
Comments
Sathya
Thursday, March 17, 2005
ads
T
Monday, May 9, 2005
ttt
MouseSkip
Tuesday, August 23, 2005
good article
daryl
Thursday, January 19, 2006
I looked at this code and the comments. I have an issue where I am using template columns and when a link button is clicked I run some code: Dim txtIPTC As TextBox = CType(DataGrid1.Items(DataGrid1.SelectedIndex).FindControl("txtIPTC"), TextBox)
Problem is that datagrid1.selectedindex, always returns -1
Comments
I have an issue where I am using template columns and when a link button is clicked I run some code:
Dim txtIPTC As TextBox = CType(DataGrid1.Items(DataGrid1.SelectedIndex).FindControl("txtIPTC"), TextBox)
Problem is that datagrid1.selectedindex, always returns -1
anyway around this?