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

[Solved] Coloring selected rows in telerik grid

3 Answers 148 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.
poonam
Top achievements
Rank 1
poonam asked on 01 Jun 2010, 10:57 AM
I have an mvc application.I am using telerik grid to show list.I want to show some rows with different colors on the basis of some conditions.How can i perform this operation on telerik grid?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Top achievements
Rank 1
answered on 01 Jun 2010, 11:35 AM
Hi,

I think this online demo covers your needs.

Regards.
Peter
0
Michiel Peeters
Top achievements
Rank 1
answered on 02 Jun 2010, 12:33 PM
Well there are different approaches possible to make this work. Like Peter said you can look into the online demo of telerik where custom formatting is made on specific cells. This kind of formatting is quite easy if you know that the data that comes in can varies between different values. If your are looking for a full row color selection (or hovering) you must look into the css file and add in the css file where a full row will be selected or hovered (normally in html this will be <tr><td></td></tr>, and you must place it on the tr tag if possible). To discover how the rows are builded up i would suggest you use firebug or the inbuild internet explorer webdesigner feature.

It is also possible to make formattings on a specific column by using the Template or ClientTemplate function. In this function you can specify your own HTML. This can be found here (for server templates) or here (for client templates). Its not difficult to do. The only problem is that you need to do some extra stuff in VB.NET 3.5 to make this work, but i think you work in C#?

Kind regards,
Michiel Peeters
0
poonam
Top achievements
Rank 1
answered on 03 Jun 2010, 05:37 AM
Thanks...
Tags
Grid
Asked by
poonam
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Michiel Peeters
Top achievements
Rank 1
poonam
Top achievements
Rank 1
Share this question
or