G
Guest
I have a datagrid on a web page. In the footer there is a field that should
be recieve the focus, either at the start or after a button is clicked to
insert the row that is being added in the footer.
I created the following Sub...
Private Sub SetFocus(ByVal ctrl As Control)
Dim SetFocus As String = "<script
language='javascript'>document.getElementById(""" & ctrl.ClientID &
""").focus();</script>"
RegisterStartupScript("SetFocus", SetFocus)
End Sub
And when I call it at the end of my ButtonClick event this is what I enter...
SetFocus(dtgIPAddresses)
in my HTML This is the entry to the control I want to select....
<FooterTemplate>
<asp:TextBox ID="txtIpAddressNew" Runat="server" TabIndex="1" />
</FooterTemplate>
I don't know what I need to do in my sub...or elsewhere to achieve this...
be recieve the focus, either at the start or after a button is clicked to
insert the row that is being added in the footer.
I created the following Sub...
Private Sub SetFocus(ByVal ctrl As Control)
Dim SetFocus As String = "<script
language='javascript'>document.getElementById(""" & ctrl.ClientID &
""").focus();</script>"
RegisterStartupScript("SetFocus", SetFocus)
End Sub
And when I call it at the end of my ButtonClick event this is what I enter...
SetFocus(dtgIPAddresses)
in my HTML This is the entry to the control I want to select....
<FooterTemplate>
<asp:TextBox ID="txtIpAddressNew" Runat="server" TabIndex="1" />
</FooterTemplate>
I don't know what I need to do in my sub...or elsewhere to achieve this...