Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > HOWTO: Bring that row back into focus ...

Reply
Thread Tools

HOWTO: Bring that row back into focus ...

 
 
So
Guest
Posts: n/a
 
      05-03-2005
HOWTO: Bring that row (in a grid) back into focus, on which a hyperlink was
clicked to navigate to Detail page.

Hi everybody,
There is a grid control on page with a hyperlink column. On clicking on of
the hyperlinks a details page is shown. The details page has a Back or
Cancel button. On clicking either of these the List page will appear. <Huh,
a common everyday scenario>. Now the thing is, how do I bring that same row
into focus on which the hyperlink was clicked, without having to scroll down
everytime I get back to the List page with the grid control.
TIA


 
Reply With Quote
 
 
 
 
guillaume StEtienne FR
Guest
Posts: n/a
 
      05-04-2005
I think the only way is to use some personnal JavaScript code. 'cos it's a
client-side functionnality.
Use that kind of dhtml client code:
<script>
.....
myHtmlLink.focus();

</script>

in this script area, you have to reference your html link object with:

myHtmlLink = document.GetElementById( idGeneratedByServerWebControl );

remember that this client script code is generated by your server-side code
( in the code behind or the aspx file).
then, to know the ID of the client-side object that represent your hyperlink
(A tag), use some code (server side) that will tell the client Jscript what
is its name:

Response.Write ( "idGeneratedByServerWebControl =" +
myHyperLinkServerSideControl.ClientID);

hope it will hep...


"So" wrote:

> HOWTO: Bring that row (in a grid) back into focus, on which a hyperlink was
> clicked to navigate to Detail page.
>
> Hi everybody,
> There is a grid control on page with a hyperlink column. On clicking on of
> the hyperlinks a details page is shown. The details page has a Back or
> Cancel button. On clicking either of these the List page will appear. <Huh,
> a common everyday scenario>. Now the thing is, how do I bring that same row
> into focus on which the hyperlink was clicked, without having to scroll down
> everytime I get back to the List page with the grid control.
> TIA
>
>
>

 
Reply With Quote
 
 
 
 
So
Guest
Posts: n/a
 
      05-13-2005
Thanks for your reply. I got it working by doing something like this:

In the Page_load of the page where this Grid List is, at the end

strFocusScript = "<script language='javascript'>"
strFocusScript = strFocusScript & "if (document.all('" & hlnk1.ClientID
& "')!=null) document.all('" & hlnk1.ClientID & "').focus()"
strFocusScript = strFocusScript & "</script>"
RegisterStartupScript(hlnk1.ClientID, strFocusScript)

where hlnk1 is initialized from the first column (a hyperlink one) of the
row that
has matching code returned back from the Details Page.

hlnk1 = CType(grd1.Items(i).Cells(0).Controls(0), HyperLink)


"guillaume StEtienne FR" <(E-Mail Removed)>
schrieb im Newsbeitrag
news:(E-Mail Removed)...
> I think the only way is to use some personnal JavaScript code. 'cos it's a
> client-side functionnality.
> Use that kind of dhtml client code:
> <script>
> ....
> myHtmlLink.focus();
>
> </script>
>
> in this script area, you have to reference your html link object with:
>
> myHtmlLink = document.GetElementById( idGeneratedByServerWebControl );
>
> remember that this client script code is generated by your server-side

code
> ( in the code behind or the aspx file).
> then, to know the ID of the client-side object that represent your

hyperlink
> (A tag), use some code (server side) that will tell the client Jscript

what
> is its name:
>
> Response.Write ( "idGeneratedByServerWebControl =" +
> myHyperLinkServerSideControl.ClientID);
>
> hope it will hep...
>
>
> "So" wrote:
>
> > HOWTO: Bring that row (in a grid) back into focus, on which a hyperlink

was
> > clicked to navigate to Detail page.
> >
> > Hi everybody,
> > There is a grid control on page with a hyperlink column. On clicking on

of
> > the hyperlinks a details page is shown. The details page has a Back or
> > Cancel button. On clicking either of these the List page will appear.

<Huh,
> > a common everyday scenario>. Now the thing is, how do I bring that same

row
> > into focus on which the hyperlink was clicked, without having to scroll

down
> > everytime I get back to the List page with the grid control.
> > TIA
> >
> >
> >



 
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
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
HOWTO: Bring that row back into focus ... So ASP .Net Datagrid Control 2 05-13-2005 01:31 PM
HOWTO: Bring that row back into focus ... So ASP .Net Building Controls 2 05-13-2005 01:31 PM
Please Help! How to bring focus back on previous frame element Dai Ba Wong Javascript 3 07-06-2004 02:15 PM



Advertisments