Click here to Skip to main content
12,075,066 members (65,020 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
i have a grid view,which show some data,
i want that when i mouse hover on that LabelTital, then show two button(edit & delete) below the label,
so plz help me, my code is below




<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"       
                  >
                   <Columns>
                     
                        <asp:TemplateField>
                       <HeaderTemplate>
                       Offer Title
                       </HeaderTemplate>
                       <ItemTemplate>
                           <asp:Label ID="LabelTital" runat="server"    Text='<%#bind("title") %>'></asp:Label>
                       </ItemTemplate>
 
                       </asp:TemplateField>
                       
                         
 

                   </Columns>
                        </asp:GridView>
Posted 5-Dec-12 1:18am
Edited 5-Dec-12 1:22am
v4

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

<script src="jquery-1.8.0.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $(".grdinvoicecss").mousemove(function (e) {
                var o = {
                    left: e.clientX,
                    top: e.clientY
                };
                $(".popupmenucss").offset(o);
                $(".popupmenucss").show();
            });
        });
    </script>

<asp:gridview id="grdInvoice1" runat="server" autogeneratecolumns="False" showheader="true" width="100%" backcolor="#EFEFEF" gridlines="None" datakeynames="invoice_id" onrowdatabound="grdInvoice1_RowDataBound" xmlns:asp="#unknown">

<asp:templatefield>
<headertemplate>









Customer name

Date

Invoice No

Amount

Tax Amount

Discount
</headertemplate>

<asp:panel runat="server" id="ItemContainer">


style="cursor: pointer">

<%# Eval("customer_name") %>

<%# Eval("invoice_date", "{0:dd/MM/yyyy}") %>

<%# Eval("invoice_no") %>

<%# Eval("sub_total") %>

<%# Eval("tax_amount") %>

<%# Eval("discount") %>

<asp:panel id="popupMenu" cssclass="popupmenucss" runat="server" style="height: 67px;<br mode=" hold=" /> width: 120px; padding-top: 10px; border-color: #00BFFF; background-color: #eeeeee;<br mode=">
<asp:linkbutton id="lkedit" text="Edit" commandname="Select" style="margin-left: 10px;">
onmouseover="this.style.color='#00BFFF';" OnClick="grdInvoice1_SelectedIndexChanged2"
onmouseout="this.style.color='black'" ForeColor="black" runat="server">



<asp:linkbutton id="lkpreview" text="Preview Report" onmouseover="this.style.color='#00BFFF'">
onmouseout="this.style.color='black'" Style="margin-left: 10px;" OnClick="lkpreview_Click"
ForeColor="black" runat="server">



<asp:linkbutton id="lkpdf" text="DownLoad PDF" onmouseover="this.style.color='#00BFFF'">
onmouseout="this.style.color='black'" Style="margin-left: 10px;" ForeColor="black"
runat="server" OnClick="lkPDF_Click">


<asp:hovermenuextender runat="server" targetcontrolid="ItemContainer" popupcontrolid="popupMenu">
PopupPosition="Center" OffsetX="50" OffsetY="-20">




  Permalink  
Comments
Arun1990 5-Dec-12 6:31am
   
i don't understand any thing in your code,plz teach me step by step how it work
RahulRana723 5-Dec-12 6:43am
   
Main Code Is Below:
<asp:hovermenuextender runat="server" targetcontrolid="ItemContainer" popupcontrolid="popupMenu">
PopupPosition="Center" OffsetX="50" OffsetY="-20">
RahulRana723 5-Dec-12 6:44am
   
You can use HoverMenuExtender from AjaxControl toolkit.
Arun1990 5-Dec-12 6:47am
   
HoverMenuExtender work fine thanks,plz put this answer in next solution then i will accept your solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160208.1 | Last Updated 5 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100