Click here to Skip to main content
15,886,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii,

I have a gridview .. in which i have label columns .. what i want to do is whenever i mouseover there on that label it should display me a label content in dialog box

XML
<script type="text/javascript" language="javascript">
             $(function () {
                 debugger;
                 $("#dialog").dialog({
                     autoOpen: false,
                     show: {
                         effect: "blind",
                         duration: 1000
                     },
                     hide: {
                         effect: "explode",
                         duration: 1000
                     }
                 });

                 $(".GRID_LBL_CLASS").hover(function () {
                     debugger;
                     $("#dialog").dialog("open");
                 });
             });
    </script>

     <asp:GridView ID="gvCalibrationHeading" runat="server" AutoGenerateColumns="false"
                                OnRowDataBound="gvCalibrationHeading_RowDataBound" OnRowCommand="gvCalibrationHeading_RowCommand"
                                DataKeyNames="HeadingId" HeaderStyle-CssClass="grid_Header" RowStyle-CssClass="grid_darkcolor"
                                AlternatingRowStyle-CssClass="grid_lightcolor" Width="100%" BorderWidth="0px">
                                <Columns>
                                    <asp:TemplateField HeaderText="Heading">
                                        <ItemTemplate>
                                            <asp:Label ID="lblHeading" runat="server" Text='<%#Eval("Heading")%>' ></asp:Label>
                                            <asp:LinkButton ID="btnCollapse" Text="+" CommandName="Collapse" runat="server" CssClass="GRID_LBL_CLASS">
                                            </asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
Posted
Comments
Torakami 24-Sep-13 6:57am    
I use a class . but that is just for identify purpose there is no such class available.

protected void Gridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + " this.style.backgroundColor='#75DCDC';");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");
}
}
 
Share this answer
 
v2
Comments
Torakami 24-Sep-13 7:21am    
Can you explain whats this for ?? i didnt understand setting the color n all ..
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900