Question : set Focus in a GridView

Hello,

I'm trying to set a focus on a gridview.
so in my rowDataBound method, I'm searching for an id. If the id is correct the focus shall be set in a textbox.
I have tried with several functions but I'm getting always the failure that the instance of an object is not set...

so far, here is my code snippet from the rowDataBound method

I have googled, searched here but all the examples I have found do not work :(

Can you help me with  your experience?
thanks in advice
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
If strSRowId = strId Then
         'rw.Focus()
         'gridSteps.Rows.Item(3).Focus()
         'Dim c As Control = e.Row.Cells(3).Controls(0)
         'c.Focus()
         'e.Row.Cells(3).Controls(0).Focus()
         'e.Row.FindControl("txtBox1").Focus()
         ' gridSteps.FindControl("txtBox1").Focus()
         'gridSteps.Rows.Item(3).FindControl("txtBox1").Focus()
         Dim TX1 As TextBox = CType(e.Row.FindControl("txtBox1"), TextBox)
         TX1.Focus()
  End If

Answer : set Focus in a GridView

document.getElementById(d of the control>).focus();  //and not setFocus()
Random Solutions  
 
programming4us programming4us