Problem when scrolling in DBGrid lazarus / 31-LCL ---------------------------------------------------------------------- T90 · 2011-09-18 16:22 Hi guys, I have done some search and never found the solution of my problem. I have a DBGrid binded with a large Dataset, so that a horizontal scrollbar appears. The problem is that the scroll slider is way larger than it should be and when it goes all the to the bottom it seems that you have reached the last row, but you are not and there are a lot more rows to show. I have not found answer to this annoying problem which makes me think that the problem is only in my "TV", but the problem was there in Lazarus 0.9.28 and the currently installed 0.9.30 on Win XP. Thanks in advance ---------------------------------------------------------------------- Bandbaz · 2011-09-18 17:13 Hi Even a StringGrid doesn't work good for me. moving the scrolls doesn't change anything. but when I use keyboard and move inside the grid, I have access to all data and scrolls move correctly. is this like your problem? Lazarus 0.9.30 gtk2 ubuntu 11.4 ---------------------------------------------------------------------- T90 · 2011-09-18 18:38 Well, I can move with the keyboard and mouse wheel correctly too, but the problem is that the scroller lies. I mean I have about 2000 rows and the slider is about 10 sm tall and when you begin to scroll down then the slider gets smaller and smaller. I am sorry if I can not explain well. ---------------------------------------------------------------------- Zoran · 2011-09-18 19:29 Quote from: T90 on September 18, 2011, 06:22:27 pmHi guys, I have done some search and never found the solution of my problem. I have a DBGrid binded with a large Dataset, so that a horizontal scrollbar appears. The problem is that the scroll slider is way larger than it should be and when it goes all the to the bottom it seems that you have reached the last row, but you are not and there are a lot more rows to show. I have not found answer to this annoying problem which makes me think that the problem is only in my "TV", but the problem was there in Lazarus 0.9.28 and the currently installed 0.9.30 on Win XP. Thanks in advance You did not tell much details about what you actually do, but here is what I guess — your dataset (TSQLQuery probably) is set to fetch limited number of records. So, I believe that your problem has nothing to do with the grid. You should know that TSQLQuery does not fetch all data by default. Your DBGrid can not know how many records are there, when only those that are currently shown in the grid are actually fetched from database. When you move cursor down through the grid, next small packet of records gets fetched. If you want all data to be fetched automatically whenever the query is opened, then you can set TSQLQuery.PacketRecords to -1 (-1 means unlimited). You should keep in mind that fetching data from big table can take time, that is why it is not the default behaviour. ---------------------------------------------------------------------- T90 · 2011-09-18 19:38 Quote from: Zoran on September 18, 2011, 09:29:17 pmQuote from: T90 on September 18, 2011, 06:22:27 pmHi guys, I have done some search and never found the solution of my problem. I have a DBGrid binded with a large Dataset, so that a horizontal scrollbar appears. The problem is that the scroll slider is way larger than it should be and when it goes all the to the bottom it seems that you have reached the last row, but you are not and there are a lot more rows to show. I have not found answer to this annoying problem which makes me think that the problem is only in my "TV", but the problem was there in Lazarus 0.9.28 and the currently installed 0.9.30 on Win XP. Thanks in advance You did not tell much details about what you actually do, but here is what I guess — your dataset (TSQLQuery probably) is set to fetch limited number of records. So, I believe that your problem has nothing to do with the grid. You should know that TSQLQuery does not fetch all data by default. Your DBGrid can not know how many records are there, when only those that are currently shown in the grid are actually fetched from database. When you move cursor down through the grid, next small packet of records gets fetched. If you want all data to be fetched automatically whenever the query is opened, then you can set TSQLQuery.PacketRecords to -1 (-1 means unlimited). You should keep in mind that fetching data from big table can take time, that is why it is not the default behaviour. What you proposed solved my problem. Thank you and Bandbaz very much for your help.