Customize sorting of Columns in jQuery DataTable plugin in GridView using in ASP.Net

Last Reply on Apr 19, 2017 02:17 AM By AnandM

Posted on Apr 14, 2017 05:33 AM

Hello Guys,

As i'm using jQuery Datatable to gridview it's working fine. but the problem is i'm, using edit and delete linkbuttons in first column as template field so what i want is to disable sort for first column.

check below screenshot



Posted on Apr 17, 2017 02:19 AM

Hi YacharuP,

You can refer below script for disabling the first column sorting for your gridview


<script type="text/javascript" src=""></script>
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript">
    $(function () {
            'aoColumnDefs': [{
                'bSortable': false,
                'aTargets': [0] /* index of the column which you want to disable */


Posted on Apr 19, 2017 02:17 AM Modified on on Apr 19, 2017 03:02 AM

Hi YacharuP,

You need to add below line of code in your jQuery ready event handler.

you need to remove the class which is getting applied to the TH while rendering into jQuery DataTable because of class the arrow icon gets displayed.


$('[id*=YourGridViewId] tr:first').eq(0).find('th').eq(0).removeClass();