all groups > vj# > may 2005 >
You're in the

vj#

group:

Make a Table Cell a Link


Make a Table Cell a Link Barry
5/18/2005 7:30:55 AM
vj#: Hi

How can i make a Table Cell a HtmlAnchor so that when the cursor is
hovering over a cell the cursor changes to Hand and i can click on the it ,
also please let me know how the event will be triggered, i am developing a
J# Control for use in a ASP.NET Web Application. Any example source code
would be most welcome.

Thanks

Barry

Re: Make a Table Cell a Link Lars-Inge Tønnessen [VJ# MVP]
5/18/2005 10:32:16 PM

[quoted text, click to view]

Re: Make a Table Cell a Link Lars-Inge Tønnessen [VJ# MVP]
5/18/2005 10:40:36 PM
Sorry, my Windows XP is not how it used to be. When I typed on my keyboard
all kinds of windows opened and closed randomly.
Here is what I ment to post:

You can do that in lots of ways. Here is one of many examples:

// Make a row
System.Web.UI.WebControls.TableRow tr = new
System.Web.UI.WebControls.TableRow();

// Add the row to the table on the screen
this.Table1.get_Rows().Add( tr );

// Add a cell with an anchor
System.Web.UI.WebControls.TableCell tc1 = new
System.Web.UI.WebControls.TableCell();
System.Web.UI.WebControls.HyperLink hp = new
System.Web.UI.WebControls.HyperLink();
hp.set_Text( "Hello" );
hp.set_NavigateUrl( "http://www.microsoft.com" );
tc1.get_Controls().Add( hp );
tr.get_Cells().Add( tc1 );

// Add an other cell
System.Web.UI.WebControls.TableCell tc2 = new
System.Web.UI.WebControls.TableCell();
tc2.set_Text( "Click on link to visit Microsoft" );
tr.get_Cells().Add( tc2 );


Regards,
Lars-Inge Tønnessen

AddThis Social Bookmark Button