how to make my textbox focus in an editable datagrid?
there is my code for update command..
Public Sub DataUpdate(ByVal Sender As Object, ByVal E As DataGridCommandEventArgs)
If CheckTime(CType(E.Item.FindControl("txtStd"), TextBox).Text) = "Error" Then
Response.Write(msgbox("Invalid Input!!"))
setFocus(CType(E.Item.FindControl("txtStd"), TextBox))
Exit Sub
End If
end sub
here is my setfocus functions..
Private Sub setFocus(ByVal ctrl As System.Web.UI.Control)
Dim s As String = ""
RegisterStartupScript("focus", s)
End Sub
the setfocus function is working properly when the control is outside the datagrid.. but i cant make it focus in my editable datagrid..
anyone knows what's going wrong??