DBGrid Scroll, right after TSQlQuery is opened from DBLookupCombobox lazarus / 16-Databases ---------------------------------------------------------------------- JZS · 2015-02-22 14:03 Complete description goes like: "issue with DBGrid Scroll, right after TSQlQuery is opened from DBLookupCombobox OnEditingDone event" I am using the 1.4RC1, but this issue is happening since I noticed in previous versions (1.2 IIRC). Anyhow, the issue is: When I open a query that is connected to a DBGrid and proceed to scroll down with the mouse on the result set, everything seems to work OK. But when I use a DBLookupComboBox to be used as a searching tool for one field, by re-querying with the selection been added to the DBGrid Query Where-Clause at OnEditingDone, it works OK, but when I scroll down with the mouse without clicking on the DBGrid to set the focus on it, the selected record is actually not matching the Dataset focused record. For example if I view the currently selected record by using a button OnClick, the moment I click on the button, the underlying Dataset seems to be pointing at the First record while the DBGrid has scrolled but without telling the Dataset to do scroll as well. But after give the DBGrid focus (left click) and scroll down the selected record matches the dataset. In short the dataset does not follow the DBGrid instantly after Query.open being called from DBLookupComboBox, the DBGrid must receive focus before the scroll, otherwise the scroll seems is on the grid interface only but not the dataset records. ---------------------------------------------------------------------- zeljko · 2015-02-22 14:36 So why you don't report issue to lazarus mantis ? ---------------------------------------------------------------------- JZS · 2015-02-22 16:45 Because am not sure if it is a bug. When I use the DBLookupCombobox's Datasource's event OnDataChange that does not happen. So do you confirm that this is a bug and should be reported? ---------------------------------------------------------------------- LuizAmérico · 2015-02-22 18:31 Not sure if i understand correct. Try setting DBLookupCombobox.ScrollListDataset to True ---------------------------------------------------------------------- JZS · 2015-02-23 03:36 Quote from: LuizAmérico on February 22, 2015, 07:31:14 pmNot sure if i understand correct. Try setting DBLookupCombobox.ScrollListDataset to True I always set ScrollListDataset to True. You won't get it until you test it. I have provided sample application with MySQL for easy testing. Code: [Select]CREATE DATABASE IF NOT EXISTS `test`; USE `test`; CREATE TABLE IF NOT EXISTS `categories` (   `cID` int(10) NOT NULL AUTO_INCREMENT,   `cName` varchar(25) NOT NULL,   PRIMARY KEY (`cID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `items` (   `iID` int(10) NOT NULL AUTO_INCREMENT,   `iName` varchar(25) NOT NULL,   `CategoryID` int(10) NOT NULL,   PRIMARY KEY (`iID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;