Magento 2 custom grid column sort order

Try this solution

  1. Use below line to sort the column in grid.

    <item name="sortOrder" xsi:type="number">6</item>
    
  2. Open you database table ui_bookmark.

  3. Search the name of your uiComponent from namespce column of ui_bookmark table. You can check uiComponent name from respective layout xml. below is just an example path.

    /app/code/Vendor/Module/view/adminhtml/layout/module__controller_index.xml
    
  4. Now delete the records that you find from ui_bookmark table.

  5. Clear the cache

    php bin/magento cache:flush
    
    php bin/magento cache:clean
    

Thats all. Enjoy!


Columns order for ui grid in Magento2 being stored in table ui_bookmark

For column namespace equal you grid name and identifier = current you should change config column value. You can find columns order there in every end of row, parameter "positions":{}


You need to check first Your "module.xml" and find the code. example :

And check the order of your module must be loaded after or before the order is depend on module load order or make sure your module load as per your requirement.

you can check your module load order etc->config.xml file.