Solved

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

Posted on 2011-02-14
2
695 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

626 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