Solved

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

Posted on 2011-02-14
2
688 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
ID: 34893322
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
ID: 34893563
Thanks so much.!it's amazing sometimes how easy something looks when you see how do do.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 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