Format Hyperlink in DataGrid

A

Alan Z. Scharf

Hi,

I'd like to format a hyperlink column in datagrid

1. Without underline, and
2. Change color on mouseover

Are there any format settings for that or is code required.

If code is required, can you refer me to some examples?

Thanks.

Alan
 
A

Alan Z. Scharf

Ken,

Thanks very much. That was incredibly easy!

The site is very valuable also.

Regards,

Alan

Ken Cox said:
Hi Alan,

You can do that sort of thing by embedding Style tags inside the Head
portion of the HTML. Here's a sample:

<style>
a { text-decoration :none }
a:hover { color:red; text-transform:uppercase; }
</style>

Click the Styles category here for more:

http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/a.asp

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto


Alan Z. Scharf said:
Hi,

I'd like to format a hyperlink column in datagrid

1. Without underline, and
2. Change color on mouseover

Are there any format settings for that or is code required.

If code is required, can you refer me to some examples?

Thanks.

Alan
 
A

Alan Z. Scharf

Ken

I changed from hyperlink to LinkButton with Select command in order to trap
event. Text value comes from database column.

Is there a way to control Hover foreground color on linkbutton?

I triedvarious things with A.linkButton: hover, but couldn't get it.

Note: The linkbutton is a DataGrid column.

Thanks very much.

Regards,

Alan



Ken Cox said:
Hi Alan,

You can do that sort of thing by embedding Style tags inside the Head
portion of the HTML. Here's a sample:

<style>
a { text-decoration :none }
a:hover { color:red; text-transform:uppercase; }
</style>

Click the Styles category here for more:

http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/a.asp

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto


Alan Z. Scharf said:
Hi,

I'd like to format a hyperlink column in datagrid

1. Without underline, and
2. Change color on mouseover

Are there any format settings for that or is code required.

If code is required, can you refer me to some examples?

Thanks.

Alan
 
K

Ken Cox [Microsoft MVP]

Hi Alan,

It should be the same as before:

A:hover { TEXT-TRANSFORM: uppercase; COLOR: red }

Can you show us a sample of the rendered HTML?

Ken

Alan Z. Scharf said:
Ken

I changed from hyperlink to LinkButton with Select command in order to
trap
event. Text value comes from database column.

Is there a way to control Hover foreground color on linkbutton?

I triedvarious things with A.linkButton: hover, but couldn't get it.

Note: The linkbutton is a DataGrid column.

Thanks very much.

Regards,

Alan



Ken Cox said:
Hi Alan,

You can do that sort of thing by embedding Style tags inside the Head
portion of the HTML. Here's a sample:

<style>
a { text-decoration :none }
a:hover { color:red; text-transform:uppercase; }
</style>

Click the Styles category here for more:

http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/a.asp

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto


Alan Z. Scharf said:
Hi,

I'd like to format a hyperlink column in datagrid

1. Without underline, and
2. Change color on mouseover

Are there any format settings for that or is code required.

If code is required, can you refer me to some examples?

Thanks.

Alan
 
A

Alan Z. Scharf

Ken,

Thanks again for your reply.

Here's what I'm doing within <HEAD/>. It worked for datagrid HyperLink
Column, but not for HyperLink Button set to Select command.

The hyperlink itself works, but is always default blue on mouseover.

Thanks.

Alan

<HTML>
<HEAD>
<title>Manager Reviews</title>
<meta content="True" name="vs_snapToGrid">
<meta content="True" name="vs_showGrid">
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="WebStylePermal.CSS" type="text/css" rel="stylesheet">
<LINK href="webMenuStylePermal.css" type="text/css" rel="stylesheet">
<style>
a { text-decoration :none }
a:hover { color:red; text-transform:uppercase; }
</style>
</HEAD>

<body MS_POSITIONING="GridLayout">......................

Ken Cox said:
Hi Alan,

It should be the same as before:

A:hover { TEXT-TRANSFORM: uppercase; COLOR: red }

Can you show us a sample of the rendered HTML?

Ken

Alan Z. Scharf said:
Ken

I changed from hyperlink to LinkButton with Select command in order to
trap
event. Text value comes from database column.

Is there a way to control Hover foreground color on linkbutton?

I triedvarious things with A.linkButton: hover, but couldn't get it.

Note: The linkbutton is a DataGrid column.

Thanks very much.

Regards,

Alan



Ken Cox said:
Hi Alan,

You can do that sort of thing by embedding Style tags inside the Head
portion of the HTML. Here's a sample:

<style>
a { text-decoration :none }
a:hover { color:red; text-transform:uppercase; }
</style>

Click the Styles category here for more:

http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/a.asp

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto


Hi,

I'd like to format a hyperlink column in datagrid

1. Without underline, and
2. Change color on mouseover

Are there any format settings for that or is code required.

If code is required, can you refer me to some examples?

Thanks.

Alan
 
K

Ken Cox [Microsoft MVP]

Hi Alan,

Could you browse to the page in IE, do View > Source and show some of the
rendered HTML for the problem grid? this shouldn't be difficult.

BTW, is it possible that one of the other stylesheets is overriding
something? Are you using a CSSClass value in the datagrid or its columns?

Thanks,

Ken
 
A

Alan Z. Scharf

Ken

I redid the datagrid and the linkbutton mouseover works fine using the
method you originally gave me.

That seemed the most logical thing to do since you indicated it should
really work.

Something must have gotten trashed somewhere.

Thanks again for your help!

Regards,

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top