ASP.net gridview and datatables working fine apart from when entering editmode

ASP.net gridview and datatables working fine apart from when entering editmode

MoiD101MoiD101 Posts: 8Questions: 0Answers: 0
edited February 2013 in General
Hi i have a asp.net gridview and i apply datatables to it and its ok (bar a little visual tweaking).

However when i click on the edit link and send the gridview into 'edit mode', the editable row shifts to the bottom of the list.

I'm thinking this is due to ordering being set on the 'Edit' column and when 'Edit' is clicked the edit mode adds a 'Cancel' link to the cell and therefore throws it to the bottom.

So i tried to remove the sorting ability off that column, with the intention of it not sorting and therefore leaving the row in its place when in 'Edit mode'.
This does not seem to have any effect, am i making some sort of noob error here?

The code i'm using is here:
[code] $(document).ready(function () {
$("#MainContent_gvPSTNResults").dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0] }
],
"bPaginate": false,
"bAutoWidth": false
});
});
[/code]

Replies

  • MoiD101MoiD101 Posts: 8Questions: 0Answers: 0
    Ok slight update, it looks as if it is not sortable when clickingon the header, however the column is highlighted in the classic 2 shades of blue as if there is some sort of sorting on it.

    is it possible to not only remove the sorting from the column, but also stop any default sorting on that column also IE absolutely no sorting at all on that column?
  • MoiD101MoiD101 Posts: 8Questions: 0Answers: 0
    ok lol sorted it with "aaSorting": [] to remove the initial sorting on the columns (this comment is for the benifit of anyone else who has this :) )
  • worthd02worthd02 Posts: 3Questions: 0Answers: 0
    Thanks for the info. This saved me a lot of time.
This discussion has been closed.