datalist attributes.add

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Reynolds

    datalist attributes.add

    Hello!

    I am trying to add onMouseOver attribute to each DataList item, but can't
    get it work...

    Somebody said that this is a bug in DataList control, if so, is there a
    workaround for this?

    Thank you in advance!
    Scott

    -------------- CODE -----------------

    Private Sub myDL_ItemDataBo und(ByVal sender As Object, ByVal e As
    System.Web.UI.W ebControls.Data ListItemEventAr gs) Handles myDL.ItemDataBo und

    Dim drv As DataRowView = CType(e.Item.Da taItem, DataRowView)

    If Not drv Is Nothing Then

    If e.Item.ItemType = ListItemType.It em OrElse e.Item.ItemType =
    ListItemType.Al ternatingItem Then
    e.Item.Attribut es.Add("onmouse over",
    "this.style.bac kgroundColor='# ff0000'")
    End If

    End If

    End Sub


Working...