[SOLVED] Make DBGrid row unselectable lazarus / 16-Databases ---------------------------------------------------------------------- pcurtis · 2021-12-25 18:20 How do I make a DBGrid row un-selectable based on a field in the underlying dataset? It should jump to the next valid available record, or if none available not move. Thanks. ---------------------------------------------------------------------- Handoko · 2021-12-25 18:54 I believe that won't be easy. Because TDBGrid is for simply showing data of the linked datasource, it will be less flexible for doing 'other' things. But if you don't mind using TStringGrid, I haven't tried but it should be much easier. Here I have an example for programmatically moving the focus cell: https://forum.lazarus.freepascal.org/index.php/topic,37286.msg250687.h tml#msg250687 So you can set any condition you like, and then move the selection to wherever you want. But if you have problem loading data to show it to a TStringGrid, here I have a demo showing how to load data from a dbf file to StringGrid: https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249208.h tml#msg249208 ---------------------------------------------------------------------- pcurtis · 2021-12-25 19:16 OK, thanks I'll have a look. @Handoko - I've been looking and found the solution I need. I will stop using DBGrid, Stringgrid is, as you said, much better. You have to think a little differently but it's worth it. Thanks.