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

[Solved] Change row fore color in RadGrid

6 Answers 718 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shiza A V
Top achievements
Rank 1
Shiza A V asked on 04 Sep 2009, 10:13 AM
How to change the radgrid row  - dataitem forecolor accoring to the value of a column.
For example: I have a column with name "type" in my radgrid.
if type column has value "o" - I want to set the entire row forecolor to blue
if type column has value "p" - I want to set the entire row forecolor to green

Please let me know how to do this.


Thanks

Shiza

6 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 04 Sep 2009, 10:28 AM
0
Shiza A V
Top achievements
Rank 1
answered on 04 Sep 2009, 11:23 AM
Hi,
Thanks for your reply.
Setting forecolor like this    dataBoundItem("ON_date").ForeColor = Drawing.Color.DarkGreen   worked

But setting the enitre row forecolor with css is not working and 
Similarly setting forecolor of  dataBoundItem("N_Desc").ForeColor = Drawing.Color.DarkGreen  does not work. This N_Desc is a bound column in detail table of radgrid

Thanks
Shiza

0
Dimo
Telerik team
answered on 04 Sep 2009, 11:36 AM
Hi Shiza,

Probably you have conflicting CSS styles in the RadGrid skin, the web page, or the RadGrid declaration. Please use Firebug or a similar tool to inspect the rendered HTML output and applied CSS styles.

If you still cannot determine the cause of the problem after trying Firebug, send us a runnable web page in a support ticket.

Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Shiza A V
Top achievements
Rank 1
answered on 04 Sep 2009, 11:51 AM
Hi,

Thanks
It worked.

Shiza
0
Dimo
Top achievements
Rank 1
answered on 06 Mar 2010, 05:04 PM
Hi, how can be changed the color of the hilight of currently client-side selectected row in RadGrid, if skin is used(wanted to override the current skin color for hilight)
0
Dimo
Telerik team
answered on 09 Mar 2010, 05:04 PM
Hi Dimo,

In order to override a RadGrid (embedded) skin, you have to use a CSS rule with a higher specificity. For more information, please refer to:

http://blogs.telerik.com/dimodimov/posts/08-06-17/how_to_override_styles_in_a_radcontrol_for_asp_net_ajax_embedded_skin.aspx

http://www.telerik.com/help/aspnet-ajax/grdcreatingnewskins.html

In short, this is what you need:

div.RadGrid_SkinName  tr.rgSelectedRow
{
          background: ...... ;
}


All the best,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Shiza A V
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Shiza A V
Top achievements
Rank 1
Dimo
Top achievements
Rank 1
Share this question
or