Conditional Cell Class

2 posts, 0 answers
  1. Jose
    Jose avatar
    4 posts
    Member since:
    May 2018

    Posted 29 May 2018 Link to this post

    Hi Team,

    I am using attribute for column definition like below and giving class for entire column. But not getting how to give cell class based on condition like for index 3 I wanted class for particular column cell.

    attributes: { "class": "my-class"},

     

    Thanks in Advance,

    Jose

  2. Stefan
    Admin
    Stefan avatar
    3008 posts

    Posted 31 May 2018 Link to this post

    Hello, Jose,

    Thank you for the details.

    This could be achieved but it will require looping through all cell on the dataBound event and programmatically set the class based on a value:

    https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/dataitem

    https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/databound

    I made an example demonstrating this:

    https://dojo.telerik.com/oYigUwOn

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top