Underline only sortable columns using css (common place) in RadGrid

3 posts, 1 answers
  1. Ravishankar
    Ravishankar avatar
    2 posts
    Member since:
    Nov 2016

    Posted 08 Nov Link to this post

    I am working on RadGrid. Somehow not able to find a css to distinguish sortable and non-sortable column. I need this because I wanted to underline only sortable columns.
  2. Answer
    Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 11 Nov Link to this post

    Hi Ravishankar,

    For sortable columns the grid generates a link element:
    <th scope="col" class="rgHeader"><a onclick="Telerik.Web.UI.Grid.Sort($find('RadGrid1_ctl00'), 'ShipName'); return false;" title="Click here to sort" href="javascript:__doPostBack('RadGrid1$ctl00$ctl02$ctl02$ctl01','')">ShipName</a></th>

    While for unsortable columns it is just plain text:
    <th scope="col" class="rgHeader">Freight</th>

    Therefore, you can use this when adding the CSS rule:
    div.RadGrid .rgHeader a {
        color: forestgreen;
    }

    That should do the trick.

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ravishankar
    Ravishankar avatar
    2 posts
    Member since:
    Nov 2016

    Posted 11 Nov in reply to Eyup Link to this post

    Thanks.

Back to Top