Advertisement

07.02.2008 at 07:45PM PDT, ID: 23535707
[x]
Attachment Details

Call Javascript popup from GridView cell

Asked by jtrapat1 in Programming for ASP.NET, JavaScript

Tags: ASP.NET, VB.NET, SQL Server 2005, Internet Explorer 6.0

I have an asp:GridView with about seven rows across.
One of the cells is a five-digit agencycode, for a long agency name.
I would like to have the user move the mouse over the agencycode cell, and call a javascript function to pass the long agencyname, and display this agencyname in a small popup window, to remind the user of which Agency the code decribes.
Since the long agencyname takes up too much space in the gridview,   In the  GridView1_RowDataBound event I add the onmouseover and onmouseout events, which will call ("window.open('javascript.htm', 'CustomPopUp',"); to show the agencyname.
Since I already have selected the long agencyname in the query but I leave the boundfield column for long agencyname hidden, Is there some way to pass this long name to a small popup window.
Thanks
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
   {
      if (e.Row.RowType == DataControlRowType.DataRow)
    ...{
       e.Row.Attributes.Add("onmouseover", ""window.open('javascript.htm', 'CustomPopUp',");
       e.Row.Attributes.Add("onmouseout", ""window.close('javascript.htm', 'CustomPopUp',");
);
       e.Row.Attributes["style"] = "Cursor:hand";
     }
  }
[+][-]07.02.2008 at 09:21PM PDT, ID: 21922661

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 09:11AM PDT, ID: 21926854

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, JavaScript
Tags: ASP.NET, VB.NET, SQL Server 2005, Internet Explorer 6.0
Sign Up Now!
Solution Provided By: prairiedog
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.03.2008 at 12:00PM PDT, ID: 21928170

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 12:22PM PDT, ID: 21928328

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 12:25PM PDT, ID: 21928351

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.03.2008 at 12:30PM PDT, ID: 21928373

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628