DBLookUpComboBox lazarus / 16-Databases ---------------------------------------------------------------------- bambamns · 2014-04-17 02:13 Hi, In my app I use DBLookUpComboBox to display content of small tables and to let user choose one value. To move cursor in database to chosen value , usually I put QueryQ.Locate('field',DBLookupComboBox.Caption,[]); in CloseUp event. Does anyone know smarter way to do this ? Thx ---------------------------------------------------------------------- jhvhs · 2014-04-17 02:35 Hi bambamns, The TDBLookupComboBox is meant to change a value in one data set using values from another dataset. So if you are trying to use it as a single-column squashed data grid, I presume you have found a nice way of doing it. Good luck! ---------------------------------------------------------------------- taazz · 2014-04-17 04:27 Quote from: bambamns on April 17, 2014, 04:13:55 amHi, In my app I use DBLookUpComboBox to display content of small tables and to let user choose one value. To move cursor in database to chosen value , usually I put QueryQ.Locate('field',DBLookupComboBox.Caption,[]); in CloseUp event. Does anyone know smarter way to do this ? Thx DBLookupComboBox.KeyValue should return the value you want no reason to use locate. ---------------------------------------------------------------------- bambamns · 2014-04-17 05:36 QuoteDBLookupComboBox.KeyValue should return the value you want no reason to use locate. Yes, but if I need value from some other field in table (like ID), I need to use locate to position the cursor. ---------------------------------------------------------------------- taazz · 2014-04-17 05:42 no, the cursor should already be in the correct record in the listsource dataset. ---------------------------------------------------------------------- eara · 2014-04-17 06:50 @bambamns: Have you tried to set the .KeyField property in designer for TDBLookUpComboBox ? ---------------------------------------------------------------------- taazz · 2014-04-17 07:12 No, currently I'm not using any data aware controls. Why do you have problems with it? ---------------------------------------------------------------------- mangakissa · 2014-04-17 11:23 Taaz is waiting for livebindings ---------------------------------------------------------------------- bambamns · 2014-04-17 19:17 Yes, I have set ListSource , ListField and KeyField. I see all the values in table field, but, as I wrote, when I choose one value , the cursor in table is not moving, so I have to move it by locate - this is natural for DBLookUpComboBox - My question is thare another, easy way (without locate) to do it. ---------------------------------------------------------------------- taazz · 2014-04-17 19:47 Is the lookupCache property set to true? ---------------------------------------------------------------------- bambamns · 2014-04-18 04:13 LookupCahche is on default false, but if I change it to true, it is the same - no change to cursor position in database. ---------------------------------------------------------------------- taazz · 2014-04-18 04:22 can you provide a small demo I'm interested in taking a closer look this is what I consider a bug that needs to be reported. ---------------------------------------------------------------------- bambamns · 2014-04-18 05:36 Yes - in att. When we speak about bug there is one connected with style property - I 'd made report http://bugs.freepascal.org/view.php?id=26006 , but this is just graphical thing (this is for wince, but it is the same issue on windows - you can see it on this demo). To use this demo you need sqlite3.dll - is it too big to att. so you can download it from https://sqlite.org/2014/sqlite-dll- win32-x86-3080403.zip