Can I change style or css for each item in listbox?

2 posts, 0 answers
  1. Warren
    Warren avatar
    61 posts
    Member since:
    Aug 2013

    Posted 17 Apr 2014 Link to this post


    I am listing items with checkboxes and I would like to use the strikethrough on the text of an item when the checkbox is checked. Kind of like a ToDo list and marking them completed. I also need to change it back when unchecking it. And I want to load the data that way. I guess I can always loop through and check to mark them and apply the css if needed.

    Would this be easier to do with a gridview control also especially since I am data binding it?


  2. Magdalena
    Magdalena avatar
    487 posts

    Posted 21 Apr 2014 Link to this post

    Hi Warren,

    The strike-through can be achieved by adding and removing CSS class which has the property text-decoration set to line-through. Please, try to apply the following:

    <telerik:RadListBox runat="server" CheckBoxes="true" OnClientItemChecked="OnClientItemCheckedHandler">

    function OnClientItemCheckedHandler(sender, eventArgs) {
        $ = $telerik.$;
        var strikethroughClassName = "strikethrough";
        var item = eventArgs.get_item();
        if (item.get_checked()) {
        else {

    .strikethrough {
        text-decoration: line-through;


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top