Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Overriding a style for the HyperlinkColumn in my datagrid: Please help me.

Reply
Thread Tools

Overriding a style for the HyperlinkColumn in my datagrid: Please help me.

 
 
SStory
Guest
Posts: n/a
 
      10-28-2003
I have a style sheet for my site. It has various classes in it.
It has <A: styles defined for all anchor tags.

I have a datagrid in ASP.NET with a stylesheet linked to the page.

It defines links as yellow which is what I normally won't but in this case I
want to override the link color and can't seem to do it.

I set the forecolor in itemstyle prop. But it doesn't work.

Any ideas?

Shane



 
Reply With Quote
 
 
 
 
SStory
Guest
Posts: n/a
 
      10-29-2003
more detailed info on my problem :

Have a data grid--for simplicity's sake defined as follows.
just look at hyperlinkcolumn definition.

<asp:datagrid id="grid" runat="server" Width="680px"
CssClass="smallblacktext" DataKeyField="jobid" AllowPaging="True"
AutoGenerateColumns="False">
<asp:HyperLinkColumn DataNavigateUrlField="Email"
DataNavigateUrlFormatString="mailto:{0}" DataTextField="email"
HeaderText="Rep Email">
<ItemStyle ForeColor="Blue" Font-Names="Arial"
></ItemStyle>

</asp:HyperLinkColumn>
</asp:datagrid>

as you can see I am trying to override with forecolor="blue" because my grid
has a white background

styles.css contains this
and I want it that way for 80% of my pages; and I have other styles in there
that I want on all my pages. How can I override this for a HyperLinkColumn?
A:link {
text-decoration: none;
font-size: 8pt;
color: #ffff00;
}

A:visited {
text-decoration: none;
font-size: 8pt;
color: #ffda00;
}

A:active {
text-decoration: none;
font-size: 8pt;
color: #FFFF00;
}

A:hover {
text-decoration: underline;
font-size: 8pt;
color: #FFFFFF;

"SStory" <> wrote in message
news:%...
> I have a style sheet for my site. It has various classes in it.
> It has <A: styles defined for all anchor tags.
>
> I have a datagrid in ASP.NET with a stylesheet linked to the page.
>
> It defines links as yellow which is what I normally won't but in this case

I
> want to override the link color and can't seem to do it.
>
> I set the forecolor in itemstyle prop. But it doesn't work.
>
> Any ideas?
>
> Shane
>
>
>



 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      10-29-2003
In article <#>, SStory wrote:
> more detailed info on my problem :
>
> Have a data grid--for simplicity's sake defined as follows.
> just look at hyperlinkcolumn definition.
>
><asp:datagrid id="grid" runat="server" Width="680px"
> CssClass="smallblacktext" DataKeyField="jobid" AllowPaging="True"
> AutoGenerateColumns="False">
> <asp:HyperLinkColumn DataNavigateUrlField="Email"
> DataNavigateUrlFormatString="mailto:{0}" DataTextField="email"
> HeaderText="Rep Email">


<asp:HyperLinkColumn ... ItemStyle-CssClass="MyHlStyle" />

and in the stylesheet

..MyHlStyle A:link, .MyHlStyle A:visited
{
color: purple;
font-size: 128pt
}


or whatever you want. That won't affect your normal <A> tags, just the
ones inside your specific hyperlink column.





--
David
dfoster at
hotpop dot com
 
Reply With Quote
 
SStory
Guest
Posts: n/a
 
      10-30-2003
Hey man you are great!!!
I have been all over the world for an answer to this and no one has
responded!

Thanks so much for the response! Works great! As you can tell I am new to
CSS.

Shane
"David" <dfoster@127.0.0.1> wrote in message
news:...
> In article <#>, SStory wrote:
> > more detailed info on my problem :
> >
> > Have a data grid--for simplicity's sake defined as follows.
> > just look at hyperlinkcolumn definition.
> >
> ><asp:datagrid id="grid" runat="server" Width="680px"
> > CssClass="smallblacktext" DataKeyField="jobid" AllowPaging="True"
> > AutoGenerateColumns="False">
> > <asp:HyperLinkColumn DataNavigateUrlField="Email"
> > DataNavigateUrlFormatString="mailto:{0}" DataTextField="email"
> > HeaderText="Rep Email">

>
> <asp:HyperLinkColumn ... ItemStyle-CssClass="MyHlStyle" />
>
> and in the stylesheet
>
> .MyHlStyle A:link, .MyHlStyle A:visited
> {
> color: purple;
> font-size: 128pt
> }
>
>
> or whatever you want. That won't affect your normal <A> tags, just the
> ones inside your specific hyperlink column.
>
>
>
>
>
> --
> David
> dfoster at
> hotpop dot com



 
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
style of inner div is not overriding that of outer div Mc Lauren Series HTML 3 02-13-2010 01:36 AM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Need some help with HyperLinkColumn! Morten ASP .Net 3 11-03-2003 01:06 PM
Override Link Style for Hyperlinkcolumn class SStory ASP .Net 3 10-30-2003 05:15 PM
Bug overriding operators in new-style classes? Nicodemus Python 0 07-17-2003 07:05 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