stringo0
stringo0

Reputation: 2760

ASP.net Adding Mouse Over To a Grid Control Cell

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.

Upvotes: 0

Views: 1110

Answers (2)

Kevin LaBranche
Kevin LaBranche

Reputation: 21078

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"

Upvotes: 2

Canavar
Canavar

Reputation: 48088

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"];
    }
  }

Upvotes: 2

Related Questions