Avatar of brgdotnet
brgdotnetFlag for United States of America

asked on 

How to change text color on Mouse Over for a bound column of an asp:DataGrid control ?

Here is the data bound column I need help with. More of the code and an explanation is shown below.

  <asp:BoundColumn DataField="SSNID" SortExpression="SSNID" HeaderStyle-ForeColor="black"  HeaderText="SSN. ID"></asp:BoundColumn>


Basically I  am working with a DataGrid control (Note, NOT a GridView control). I have a bound column below for the social security column,  "SSNID". When the application user
places their mouse cursor over the column header SSN. ID, I would like for the text color to change to a different color, like blue. Also it would be nice
if the cursor changes to a hand icon on hover. However just getting the text color to change on MouseOver is my main requirement right now that I am trying
to fulfill. Does anyone know how to do this?



 <asp:DataGrid ID="dgGridLIst" runat="server" Width="700px" CssClass="mainbody" PageSize="25" AutoGenerateColumns="False"  AllowPaging="True" OnSortCommand="Sort_DataGrid" AllowSorting="true" PagerStyle-PrevPageText="Prev" PagerStyle-NextPageText="<img src='~/images/cssgrid.gif' " OnPageIndexChanged="dgGridLIst_PageIndexChanged" OnItemCreated="dgGridLIst_ItemCreated">
        <HeaderStyle Font-Bold="True"></HeaderStyle>
        <Columns>
            <asp:TemplateColumn>
                <ItemTemplate>
                     <asp:HyperLink ID="HyperLink2" runat="server" Text="Select" NavigateUrl='<%#: GetRequestId(DataBinder.Eval(Container.DataItem, "SSNID").ToString()) %>' Target="_blank">Select</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="SSNID" SortExpression="SSNID" HeaderStyle-ForeColor="black"  HeaderText="SSN. ID"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="Stat.">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" >
                                  <%# GetStatusDescription(DataBinder.Eval(Container.DataItem, "REQUEST_STS").ToString()) %>
                    </asp:Label>
                </ItemTemplate>
            </asp:TemplateColumn>
ASP.NET

Avatar of undefined
Last Comment
brgdotnet
Avatar of Russ Suter
Russ Suter

It's easy with CSS but you'd have to write the CSS to the rendered HTML and not to the ASP.NET markup. Do you have a sample of the rendered page?
Avatar of brgdotnet
brgdotnet
Flag of United States of America image

ASKER

No, I don't have a sample of the page. I have tried styling it with CSS, but it did not work. Do you know of any good CSS that can accomplish the job? Change text color on hover, and show a hand instead of the cursor.
ASKER CERTIFIED SOLUTION
Avatar of Russ Suter
Russ Suter

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of brgdotnet
brgdotnet
Flag of United States of America image

ASKER

THank you
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo