This is a migrated thread and some comments may be shown as answers.

IE7 BackColor issue

2 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 25 Apr 2012, 09:51 PM
I have a radgrid that I check values on ItemDataBind to see if they're in a list.  If they're in the list I set the backcolor to Salmon like this:
protected void RadGrid4_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
       {
           if (e.Item.ItemType == Telerik.Web.UI.GridItemType.Item || e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem)
           {
               string id = e.Item.Cells[2].Text;
               if (!isCurrentShowcase(id))
               {
                   if (e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem)
                   {
                       e.Item.BackColor = System.Drawing.Color.Salmon;
                   }
                   else
                   {
                       e.Item.BackColor = System.Drawing.Color.LightSalmon;
                   }
               }
           }
       }

This works fine in IE9 and Firefox but the colors don't come through on IE7.  While I'd love to just say upgrade, not everyone that will use the system is capable of doing so.  Is there some sort of workaround or change I can make to get this to work in IE7?  Using 2012.1.411.35

I think this worked in previous versions of the control, so I don't know if this is something that was changed in the latest version or not.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 27 Apr 2012, 04:07 PM
This shouldn't be in the MVC section, I must've not been looking at the correct place when posting initially.  This is for the regular ASP.NET AJAX version.

I was still having the problem and needed some sort of solution so I found a work-around.  I set each cells color in the row and that works fine in IE7:
protected void RadGrid4_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
       {
           if (e.Item.ItemType == Telerik.Web.UI.GridItemType.Item || e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem)
           {
               string id = e.Item.Cells[2].Text;
               if (!isCurrentShowcase(id))
               {
                   foreach (TableCell tc in e.Item.Cells)
                   {
                       if (e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem)
                       {
                           tc.BackColor = System.Drawing.Color.Salmon;
                       }
                       else
                       {
                           tc.BackColor = System.Drawing.Color.LightSalmon;
                       }
 
                   }        
               }
           }
       }
0
Vasil
Telerik team
answered on 30 Apr 2012, 02:21 PM
Hello Chris,

I don't see a reason for your implementation to not work. Can you inspect some row that should have the applied style, and see if the BackColor is rendered in the HTML markup? Also check what CSS selector is applied on the rows. And where the selector it is defined, is it for some build-in style or a custom style in your page.
If you insulate the problem in sample working code I would try to debug it further.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or