scroll to end of dbgrid lazarus / 16-Databases ---------------------------------------------------------------------- mirce.vladimirov · 2011-09-13 20:31 I'm using winXP, lazarus 0.9.30 with MySQL.  There is a form that I use to enter a lots of data in a table, but It always shows the top lines of the DBGrid. How can I make it to show the tail of the DBgrid, the las records that I entered each time I do a "myquery.open" ? I already tried with myquery.open ; myquery.last ; wich i use under Delphi and works, but in Lazarus doesnot work , just keeps showing the top lines of a DBgrid. ---------------------------------------------------------------------- jwdietrich · 2011-09-13 20:34 This is an interesting question. If somebody has a solution, I would be most interested in one that also works for StringGrids. ---------------------------------------------------------------------- mirce.vladimirov · 2011-09-14 13:42 QuoteThis is an interesting question. Ofcourse it is, but as we can see, no one else cares ---------------------------------------------------------------------- mirce.vladimirov · 2011-09-14 13:52 Quote from: jwdietrich on September 13, 2011, 10:34:39 pmI would be most interested in one that also works for StringGrids. Code: [Select]StringGrid1.TopRow:=StringGrid1.RowCount-10; Let us say that your stringgrid shows 10 rows at a time, this line of code displays the last 10 lines of the string grid. I just don't understand why the simple Delphi solution "Myquery.last ;" doesnot work ? ---------------------------------------------------------------------- jesusr · 2011-09-14 18:34 Dataset.Last; Works here (using lazarus 0.9.31, svn version), the grid shows the last records in database while the current record is the last one. Are you using dataset.DisableControls? ---------------------------------------------------------------------- mirce.vladimirov · 2011-09-16 21:01 Quote from: jesusr on September 14, 2011, 08:34:54 pmDataset.Last; Works here (using lazarus 0.9.31, svn version), the grid shows the last records in database while the current record is the last one. Are you using dataset.DisableControls? No, I don't use dataset, i don't even know what is that. Is there a link with documentation about it ? Some examples ? ---------------------------------------------------------------------- jesusr · 2011-09-17 04:44 There is no way to use a dbgrid without a dataset, in your case it seems to be myquery which should (in fact it must) be a dataset descendant component. ---------------------------------------------------------------------- m.vincent · 2011-09-19 14:12 myquery.last should work  - can you look if it is a listed bug - if not add it. I have two thoughts: 1) would it suit your app / gui to have the recently added record at the top of the grid and order the records using ORDER BY in the SQL? 2) as a horrible, clunky work around, you could disable controls, then step through to the last record using myquery.next.  (It'll get it working until a proper fix is found). Regards, Mike