Hi,

For datagrid you can write like this :

if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType ==
ListItemType.AlternatingItem)
            {
                e.Item.Attributes.Add("onmouseover",
"this.style.backgroundColor='#7f9db9'");

            }
            if (e.Item.ItemType == ListItemType.Item)
            {
                e.Item.Attributes.Add("onmouseout",
"this.style.backgroundColor='#FFFFFA'");
            }
            else
            {
                e.Item.Attributes.Add("onmouseout",
"this.style.backgroundColor='#FFFFFA'");
            }

On Mon, Feb 22, 2010 at 6:54 PM, Eder Sousa <[email protected]> wrote:

> I am trying to change the color of the row which was selected by the mouse
> on the gridview (VB.NET <http://vb.net/>).
> I tried a lot of code and a resulted on thins:
>
> Protected Sub gvRestricaoDisponivel_RowDataBound(ByVal sender As Object,
> ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
> gvRestricaoDisponivel.RowDataBound
> ' If ((e.Row.RowState And e.Row.RowType = DataControlRowType.DataRow) > 0)
> Then
> If (e.Row.RowState = DataControlRowState.Selected) Then
> e.Row.Cells(2).BackColor = Drawing.Color.Yellow
> End If
> ' End If
> End Sub
>
>
> But it does not work, pelase HELPPPPPP
>
> --
> Eder Sousa
> Technology Information
> [email protected]
> [email protected]
> [email protected]
>
>


-- 
"People who never make mistakes, never do anything."

dEv

Reply via email to