Mouseover/Mouseout for Gridview cells

Discussion in 'ASP .Net' started by =?Utf-8?B?TWF0dCBDb2xlZ3JvdmU=?=, Mar 11, 2006.

  1. 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 OnItemBoundDataGrid event
     
    =?Utf-8?B?TWF0dCBDb2xlZ3JvdmU=?=, Mar 11, 2006
    #1
    1. Advertising

  2. Sub CustomersGridView_RowDataBound(ByVal sender As Object, ByVal e As
    GridViewRowEventArgs)

    If e.Row.RowType = DataControlRowType.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","this.className='somethingelse'")

    End If

    End Sub

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Matt Colegrove" wrote:

    > 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 OnItemBoundDataGrid event
     
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Mar 11, 2006
    #2
    1. Advertising

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

    "Phillip Williams" wrote:

    > Sub CustomersGridView_RowDataBound(ByVal sender As Object, ByVal e As
    > GridViewRowEventArgs)
    >
    > If e.Row.RowType = DataControlRowType.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","this.className='somethingelse'")
    >
    > End If
    >
    > End Sub
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Matt Colegrove" wrote:
    >
    > > 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 OnItemBoundDataGrid event
     
    =?Utf-8?B?TWF0dCBDb2xlZ3JvdmU=?=, Mar 12, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Walzenbach
    Replies:
    1
    Views:
    845
    Steven Cheng[MSFT]
    Feb 18, 2004
  2. =?Utf-8?B?TWljaGFlbCBN?=

    asp:datagrid style on mouseover mouseout

    =?Utf-8?B?TWljaGFlbCBN?=, May 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,933
    =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    May 18, 2004
  3. Replies:
    1
    Views:
    508
    S.M. Altaf [MVP]
    Nov 25, 2005
  4. =?Utf-8?B?SGFyZHkgV2FuZw==?=

    Image mouseover/mouseout attributes and Theme/Skin question

    =?Utf-8?B?SGFyZHkgV2FuZw==?=, Feb 13, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    433
    =?Utf-8?B?SGFyZHkgV2FuZw==?=
    Feb 13, 2007
  5. Mouseover, mouseout, click etc on datagrid.

    , Nov 25, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    175
Loading...

Share This Page