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

How to use my own CSS class in <a> in grid?

1 Answer 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 29 May 2012, 05:22 PM
I'm trying to use my own CSS class to style an element in a grid cell, but Kendo's styles are overriding my class and not allowing my style. How do I use my own style in a grid cell?

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 30 May 2012, 11:22 AM
Hi Jay,

You could set a custom CSS style for a particular element in a grid cell via template in the column. For example:  

$("#grid").kendoGrid({
  ...
  columns: [
    ...
    {field: "FieldName",
     title: "FieldName",
     template: "#= (FieldName== 'ConditionName') ? '<span class=\"customClass\">FieldName</span>' : FieldName#"}
  ]
});

For convenience I created a simple example which illustrates such approach in action - please find it attached. 

Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Jay
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or