Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-02-14
2
Medium Priority
?
698 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 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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 …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

916 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