Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SetFocus on a specific cell in datagrid

Reply
Thread Tools

SetFocus on a specific cell in datagrid

 
 
=?Utf-8?B?TXJzTGVpZ2g=?=
Guest
Posts: n/a
 
      01-26-2006
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...


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: fire event when click on specific cell in dataGrid using asp.net Eliyahu Goldin ASP .Net 1 07-31-2004 12:11 PM
RE: fire event when click on specific cell in dataGrid using asp.net =?Utf-8?B?YW5nc3JhbQ==?= ASP .Net 1 07-31-2004 11:57 AM
Re: fire event when click on specific cell in dataGrid using asp.net Cory D. ASP .Net 1 07-28-2004 10:27 AM
Re: fire event when click on specific cell in dataGrid using asp.net John Saunders ASP .Net 0 07-27-2004 09:31 PM
Populate Session Variables from Datagrid for a specific cell coleenholley ASP .Net 3 02-03-2004 10:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57