Drag n drop - hinder certain rows from being dragged

Drag n drop - hinder certain rows from being dragged

Considering this code I'm using for drag n drop:

  1. $(".gridview").sortable({
  2.                 //items: 'tr:not(tr:first-child)',
  3.                 items: 'tr',
  4.                 cursor: 'pointer',
  5.                 axis: 'y',
  6.                 dropOnEmpty: false,
  7.                 start: function (e, ui) {
  8.                     ui.item.addClass("selected");
  9.                 },
  10.                 stop: function (e, ui) {
  11.                     ui.item.removeClass("selected");
  12.                 },
  13.             });

I would like to lock some rows based on the cell value. Maybe I could use something like 'tr:not(tr:first-child)', but instead based on the cell value rather than first, second and so on.

So I would prevent some rows from being dragged by the USER, but still I want these rows the be able to change position if neccessary. For instance if a row is dragged above a "non-dragable-row", the non-dragable-row still needs to be able to move down one step.

So most of the rows would be dragable, then a few will be non dragable, but in code behind they would still need to be able to change position.

How could this be done, if possible?