Sorting a DBGrid in Lazarus should (!) be easy - (a) write code or (b) just add a component and avoid writing code. Done it before. But it turned into a much bigger experiment! Here’s what I cover in this full walkthrough: 1. Adding sorting to a grid. 2. Code vs using an existing component. 3. Why I thought the component would be easier. 4. Installing via the Online Package Manager (OPM). 5. Out-of-date documentation for both OPM and DBGridController. 6. Working out how to make the component actually function. 7. Running into problems with maximum indexes and program crashes on exit. And towards the end of this video worked fixes for issues: clearing the grid on form close and updating query component settings. By the end, you’ll see the trade-offs between writing the sorting code yourself and relying on a “no-code” solution. Both approaches can work, but each comes with its own surprises. Links: 🔗 Grids Reference Page - #Example:_How_to_export_a_DBGrid_to_a_text_file 🔗 DbGridController - 🔗 Online Package Manager - #FreePascal #Lazarus #PascalProgramming #DBGrid #DatabaseApps











