Solved

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

Posted on 2011-02-14
2
694 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

759 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