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

Change row color

8 Answers 251 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Johny
Top achievements
Rank 2
Johny asked on 31 Jul 2010, 03:08 PM
Hi Guys
I want to change row color based on column value, How can I do this.. I'm using telerik 2008.

8 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 02 Aug 2010, 02:17 PM
Hello Johny,
(I already answered this here)

I have no ideea what's changed since then but if you want to format a row, in my personal opinion, you should use the CellFormatting event:
"
Telerik Documentation Formatting Cells or RowFormatting event:Telerik Documentation Formatting Rows.

And an answer from telerik says that:
 "As long as the RadGridView control uses UI virtualization, GridCellElement and GridRowElement should be used only in formatting events. Please refer to this blog post for more information about virtualization and formatting."

Try them and use whichever suits your needs the best.
"

Best Regards,
Emanuel Varga
0
Johny
Top achievements
Rank 2
answered on 02 Aug 2010, 03:33 PM
Hi Emanuel Varga:

Thanks for your reply, I don't know why your given link showing HTTP 404 error, however other stuff are helpful to me.
Could you please post sample code snippets for me.

Regards
Johny
0
Emanuel Varga
Top achievements
Rank 1
answered on 02 Aug 2010, 03:36 PM
Hello again,

I guess they changed the links for the documentation, anyhow this is for the RowFormatting and for the CellFormatting

Sorry about that
0
Johny
Top achievements
Rank 2
answered on 02 Aug 2010, 03:42 PM
Hey Varga: Thanks a lot...... :)
0
Alexander
Telerik team
answered on 04 Aug 2010, 03:12 PM
Hello Johny,

Thank you for your question.

As Emanuel explained, in order to change row color based on cell value you can use the RadGridView formatting events.

A second option is to use conditional formatting. You can read about this method in this help article.

All the best,
Alexander
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
0
Emanuel Varga
Top achievements
Rank 1
answered on 04 Aug 2010, 03:22 PM
Hello Alexander,

Until recently I've been using mostly conditional formatting, but conditional formatting has some problems changing the back Color of the row to reflect the OnHover event.

Best Regards,
Emanuel Varga
0
Johny
Top achievements
Rank 2
answered on 04 Aug 2010, 04:10 PM
Hi Varga
Absolutely right! I agree with you...

Thanks
Md. Marufuzzaman
0
Alexander
Telerik team
answered on 06 Aug 2010, 04:01 PM
Hello,

The Conditional formatting defines the local value for the visual properties of the cells. It has higher priority than the styles, defined by the theme. That is why the theme hover style does not affect the cells visual appearance when it is set using conditional formatting.

Regards,
Alexander
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
GridView
Asked by
Johny
Top achievements
Rank 2
Answers by
Emanuel Varga
Top achievements
Rank 1
Johny
Top achievements
Rank 2
Alexander
Telerik team
Share this question
or