Mouseover/Mouseout for Gridview cells

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Colegrove

    #1

    Mouseover/Mouseout for Gridview cells

    How does one set a Mouseover/Mouseout event on a cell in a GridView? I can
    successfully assign these events to be active on a row in a GridView.

    I can do this with a DataGrid, by adding code to the OnItemBoundData Grid event
  • Phillip Williams

    #2
    RE: Mouseover/Mouseout for Gridview cells

    Sub CustomersGridVi ew_RowDataBound (ByVal sender As Object, ByVal e As
    GridViewRowEven tArgs)

    If e.Row.RowType = DataControlRowT ype.DataRow Then
    'change the hover effect over the first cell in the row

    e.Row.Cells(1). Attributes.Add( "onmouseover"," this.className= 'something'")

    e.Row.Cells(1). Attributes.Add( "onmouseout","t his.className=' somethingelse'" )

    End If

    End Sub

    --
    HTH,
    Phillip Williams




    "Matt Colegrove" wrote:
    [color=blue]
    > How does one set a Mouseover/Mouseout event on a cell in a GridView? I can
    > successfully assign these events to be active on a row in a GridView.
    >
    > I can do this with a DataGrid, by adding code to the OnItemBoundData Grid event[/color]

    Comment

    • Matt Colegrove

      #3
      RE: Mouseover/Mouseout for Gridview cells

      That's exactly what I was looking for. Thanks!!

      "Phillip Williams" wrote:
      [color=blue]
      > Sub CustomersGridVi ew_RowDataBound (ByVal sender As Object, ByVal e As
      > GridViewRowEven tArgs)
      >
      > If e.Row.RowType = DataControlRowT ype.DataRow Then
      > 'change the hover effect over the first cell in the row
      >
      > e.Row.Cells(1). Attributes.Add( "onmouseover"," this.className= 'something'")
      >
      > e.Row.Cells(1). Attributes.Add( "onmouseout","t his.className=' somethingelse'" )
      >
      > End If
      >
      > End Sub
      >
      > --
      > HTH,
      > Phillip Williams
      > http://www.societopia.net
      > http://www.webswapp.com
      >
      >
      > "Matt Colegrove" wrote:
      >[color=green]
      > > How does one set a Mouseover/Mouseout event on a cell in a GridView? I can
      > > successfully assign these events to be active on a row in a GridView.
      > >
      > > I can do this with a DataGrid, by adding code to the OnItemBoundData Grid event[/color][/color]

      Comment

      Working...