Sorting DBGrid with SQLite3Dataset lazarus / 16-Databases ---------------------------------------------------------------------- dsyrios · 2017-02-12 18:32 Hi, I have not much experience on databases, so I want some help for Sorting DBGrid by OnTitleClick with SQLite3Dataset. Is there any example? Thanks in advance. using Laz 1.6.2 / win32 ---------------------------------------------------------------------- madref · 2017-02-14 00:04 Then you need to do a few steps: * Know which part has been selected. * rewrite your query for the DBGrid with an 'ORDER BY ...' in it. * then refresh your DBGrid ---------------------------------------------------------------------- Jurassic Pork · 2017-02-14 04:04 hello, you can try to use the code which is  in the  lazarus wiki Grids_Reference_Page/Sorting columns or rows in DBGrid with sort arrows in column header here : i have tried this code with my lazarus database example : lazarus/examples/database/image_mushrooms . It seems to be OK. components in my sqlite3 database example : TDbgrid, TSqlite3Connection, TSqlQuery ... see in attachment the code in action in my example Friendly, J.P ---------------------------------------------------------------------- dsyrios · 2017-02-16 10:07 Thanks !