We help IT Professionals succeed at work.
Get Started

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

brgdotnet asked
Last Modified: 2016-03-21
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>
                     <asp:HyperLink ID="HyperLink2" runat="server" Text="Select" NavigateUrl='<%#: GetRequestId(DataBinder.Eval(Container.DataItem, "SSNID").ToString()) %>' Target="_blank">Select</asp:HyperLink>
            <asp:BoundColumn DataField="SSNID" SortExpression="SSNID" HeaderStyle-ForeColor="black"  HeaderText="SSN. ID"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="Stat.">
                    <asp:Label ID="Label1" runat="server" >
                                  <%# GetStatusDescription(DataBinder.Eval(Container.DataItem, "REQUEST_STS").ToString()) %>
Watch Question
Senior Software Developer
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE