public function getManipulatedData(GridField $grid, SS_List $list) { $state = $grid->getState(); $sorted = (bool) (string) $state->GridFieldSortableHeader->SortColumn; // If the data has not been sorted by the user, then sort it by the // sort column, otherwise disable reordering. $state->VersionedGridFieldOrderableRows->enabled = !$sorted; if (!$sorted) { return $list->sort($this->getSortField()); } else { return $list; } }