Private Sub dg_ItemCreated(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles dg.ItemCreated
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor
= 'lightgreen';")
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor
= 'white';")
End If
End Sub
HTH,
Greg
"Avi Shilon" <Av*******@discussions.microsoft.com> wrote in message
news:C0**********************************@microsof t.com...
Nope :)
I'm totally new to asp.net and
its controls. I didn't even know
that the datagrid had an attributes
property (it is a property, right?)
Thanks for any help you give, guys
"William Main" wrote:
have you tried
datagrid1.attributes("onmouseover")="myjavafunctio n()"
--
William Main
"Avi Shilon" wrote:
> Hi,
>
> I want to create a client-side script
> that highlights a row of a datagrid control
> when the mouse cursor is over that row (i.e.
> chage the color of the row to something else
> than the current color), but apparently the
> datagrid doesn't have an OnMouseOver event.
> It works with regular html tables but not with
> the datagrid control. is there a way to do it?
>
> Thanks