0

Is it possible to add a java script mouse over to a grid control cell? If so, how do you do it?

Specifically, we're trying to show a different tool tip for each cell, not the entire column or row.

2 Answers 2

2

You should be able to add the tooltip to each cell / column like so:

gridview.rows(x).cells(y).ToolTip="blah"

or say in the RowDataBound event...

e.Row.Cells(x).ToolTip="blah"

Sign up to request clarification or add additional context in comments.

1 Comment

This is the easiest solution for our scenario.
2

Yes it's possible. At your grid's RowDataBound, try to add your javascript using Row.Cells :

  void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
  {
    if(e.Row.RowType == DataControlRowType.DataRow)
    {
        //e.Row.Cells[1].Attributes["onmouseover"];
    }
  }

2 Comments

How do I pass in the JS function to call?
e.Row.Cells[1].Attributes["onmouseover"] = "javascript:YourFunction();" You will have to figure out how to pass the function your cell info for it to work.... Don't know how you have your JS setup....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.