Welcome Guest Search | Active Topics | Sign In | Register

Change background of a cells Options
AndreaZ
Posted: Tuesday, May 12, 2009 7:05:14 AM
Rank: Advanced Member
Groups: Member

Joined: 10/20/2008
Posts: 75
How can i change the backgroung-color of a cells of eo:grid ?

Code: Visual Basic.NET
For Each Item As EO.Web.GridItem In Grid1.Items
                If Item.Cells("myval").Value = "GREEN" Then
                    Item.Cells("myval").Style = "background-color:#00FF00;"
                End If
            Next


this code don't works.
thanks.
eo_support
Posted: Tuesday, May 12, 2009 10:27:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

GridCell.Style takes a CSS class name, not inline CSS text. So it will be something like Item.Cells("myval").Style = "green_text". While you have class "green_text defined in your CSS file:

Code: CSS
.green_text
{
    background-color:#00FF00;
}


Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.