Click here to Skip to main content
15,922,309 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how can i upload video or audio file into database? Pin
Not Active4-Jan-11 12:40
mentorNot Active4-Jan-11 12:40 
QuestionHow can I display a pop-up when hovering over a Gridview row? Pin
JTRizos4-Jan-11 6:50
JTRizos4-Jan-11 6:50 
AnswerRe: How can I display a pop-up when hovering over a Gridview row? Pin
Not Active4-Jan-11 8:05
mentorNot Active4-Jan-11 8:05 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos4-Jan-11 9:33
JTRizos4-Jan-11 9:33 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Not Active4-Jan-11 9:56
mentorNot Active4-Jan-11 9:56 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos4-Jan-11 11:00
JTRizos4-Jan-11 11:00 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad4-Jan-11 9:59
professionalParwej Ahamad4-Jan-11 9:59 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 6:25
JTRizos12-Jan-11 6:25 
Thanx to the feedback I've recieved from this forum, I think I am almost there. Viewing the source I can see that the onmouseover and onmouseout controls have been added to each row in the Gridview as intended. However, I get a "Microsoft JScript runtime error: Object expected" error. I cannot figure out why. The code is as follows:

.aspx code

<script type="javascript">
        function ShowTooltip(LName,FName,JUDesc,JTDesc)
        {   
            document.getElementById("td0").innerText=LName;
            document.getElementById("td1").innerText=FName;
            document.getElementById("td2").innerText=JUDesc;
            document.getElementById("td3").innerText=JTDesc;
            x=event.clientX + document.body.scrollLeft;
            y=event.clientY + document.body.scrollTop + 10;
            Popup.style.display="block";
            Popup.style.left=x;
            Popup.style.top=y;
        }
        
        function HideToolTip()
        {
            Popup.style.display="none";
        }
  </script>
    
    
    <div id="Popup" class ="transparent">
        <div style="BACKGROUND-COLOR:#003366"><center><b>Employee Info</b></center></div>
        <div>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td id="td0" align="left"></td>
                </tr>
                <tr>
                    <td id="td1" align="left"></td>
                </tr>
                <tr>
                    <td id="td2" align="left"></td>
                </tr>
                <tr>
                    <td id="td3" align="left"></td>
                </tr>
             </table>
        </div>
    </div>


.aspx.cs code

private void InitializeComponent()
    {
        this.gvRoles.RowDataBound += new GridViewRowEventHandler(this.gvRoles_RowDataBound);
    }

public void gvRoles_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.DataItem != null)
        {
            e.Row.Attributes.Add("onmouseover", "ShowTooltip('" +
                DataBinder.Eval(e.Row.DataItem, "EmployeeNameLast").ToString() + "','" +
                DataBinder.Eval(e.Row.DataItem, "EmployeeNameFirst").ToString() + "','" +
                DataBinder.Eval(e.Row.DataItem, "JobUnitDescription").ToString() + "','" +
                DataBinder.Eval(e.Row.DataItem, "JobTitleDescription").ToString() + "');");
            e.Row.Attributes.Add("onmouseout", "HideToolTip();");
        }
        else
        {
            lblError.Text = "Nothing to report ";
        }
    }


Any advise will be much appreciated. Thanx again for the feedback.
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 6:43
professionalParwej Ahamad12-Jan-11 6:43 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 7:05
JTRizos12-Jan-11 7:05 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 7:17
professionalParwej Ahamad12-Jan-11 7:17 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 7:49
JTRizos12-Jan-11 7:49 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 8:09
professionalParwej Ahamad12-Jan-11 8:09 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 8:20
JTRizos12-Jan-11 8:20 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 8:24
professionalParwej Ahamad12-Jan-11 8:24 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 8:35
JTRizos12-Jan-11 8:35 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 8:43
professionalParwej Ahamad12-Jan-11 8:43 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 8:59
JTRizos12-Jan-11 8:59 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
JTRizos12-Jan-11 9:08
JTRizos12-Jan-11 9:08 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 9:12
professionalParwej Ahamad12-Jan-11 9:12 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Pin
Parwej Ahamad12-Jan-11 9:05
professionalParwej Ahamad12-Jan-11 9:05 
AnswerRe: How can I display a pop-up when hovering over a Gridview row? Resolved Pin
JTRizos12-Jan-11 12:22
JTRizos12-Jan-11 12:22 
GeneralRe: How can I display a pop-up when hovering over a Gridview row? Resolved Pin
Parwej Ahamad12-Jan-11 19:17
professionalParwej Ahamad12-Jan-11 19:17 
QuestionFindControl("id"); does not work - another alternative? Pin
lvq6844-Jan-11 4:44
lvq6844-Jan-11 4:44 
AnswerRe: FindControl("id"); does not work - another alternative? Pin
Manas Bhardwaj4-Jan-11 5:59
professionalManas Bhardwaj4-Jan-11 5:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.