Solved

how to get invisible column from gridview and put in a tooltip

Posted on 2011-02-14
2
676 Views
Last Modified: 2012-05-11
I have to get the data from the invisible Label "LabelTooltip" and put the text as a tooltip in the
asp:HyperLink ID="hlUrl". I think i need some c# code behind but don't know to do this.

            <div id="MasterPageEvents">
                <div id="MasterPageEventsDatesLeftSideMargin">
                </div>
                <div id="MasterPageEventsDates">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ShowHeader="False"
                        DataSourceID="SqlDataSourceLakeEvents" AllowPaging="True" GridLines="None" PageSize="3"
                        Caption="Upcoming Events" CaptionAlign="Top" BackColor="Transparent" EmptyDataText="No Events Found"
                        Font-Size="Medium" BorderStyle="Solid" BorderWidth="5px" CellPadding="5"
                        Font-Names="Calibri"
                         OnRowDataBound="GridView1_RowDataBound">
                        <RowStyle Font-Strikeout="False" ForeColor="Black" />
                        <Columns>
                            <asp:TemplateField HeaderText="Time" SortExpression="Time">
                                <ItemTemplate>
                                    <asp:Label ID="Labeldate" runat="server" Text='<%# (Eval("EventDate","{0:g}")) %>'
                                        Font-Size="Small"></asp:Label>
                                       
                                    <asp:HyperLink ID="hlUrl" runat="server" NavigateUrl='<%# "EventsShowcase.aspx?eventid=" + Eval("EventId") %>'
                                        Text='More...' ToolTip="Tooltip goes here" />
                                        <br />

                                    <asp:Label ID="LabelTooltip" runat="server" Text='<%# (Eval("tooltip"))%>' Visible="False">
</asp:Label><br />
                                </ItemTemplate>
                               
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left" Wrap="False" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle ForeColor="Black" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSourceLakeEvents" runat="server" ConnectionString="<%$ ConnectionStrings:LLIAConnectionString %>"
                       
                       
                       
                        SelectCommand="SELECT events.eventcomment, events.eventdate, events.eventid, events.tooltip FROM events INNER JOIN eventtype ON events.eventtype = eventtype.eventtype WHERE (events.eventdate &gt;= GETDATE()) ORDER BY events.eventdate">
                    </asp:SqlDataSource>
0
Comment
Question by:ggaarryy
2 Comments
 
LVL 8

Accepted Solution

by:
PagodNaUtak earned 500 total points
Comment Utility
You do not need serverside or client side code for that, try to change the mark up like the one shown below.
All you need to do is add ToolTip='<%# (Eval("tooltip"))%>' in your <asp:HyperLink> tag.
<asp:HyperLink ID="hlUrl" runat="server" NavigateUrl='<%# "EventsShowcase.aspx?eventid=" + Eval("EventId") %>' Text='More...' ToolTip='<%# (Eval("tooltip"))%>' />

Open in new window

0
 

Author Closing Comment

by:ggaarryy
Comment Utility
Thanks so much.!it's amazing sometimes how easy something looks when you see how do do.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now