Behdadsoft 0 Posted April 17, 2022 Hi. I have a DBGrid on my form that contain many rows. the problem is that, scrollbar don't work normally like other programming language. I searched in google for find a solution for this issue but I couldn't find anything. for better understanding, I captured a video from C# DataGridView and Delphi DBGrid that the problem is obvious. Also I Use Delphi 11.1. Video: Compare C# and Delphi Scrollbar Share this post Link to post
Attila Kovacs 631 Posted April 17, 2022 51 minutes ago, Behdadsoft said: scrollbar don't work normally like other programming language What makes you think the "other" is the normal? For me, it's abnormal. Share this post Link to post
Behdadsoft 0 Posted April 17, 2022 21 minutes ago, Attila Kovacs said: What makes you think the "other" is the normal? For me, it's abnormal. If you select a row in DBGrid and with moving scrollbar selected row changes it's normal? it should only scroll page to up or down and not change selection. Something that happens in C# and other. Share this post Link to post
PeterBelow 239 Posted April 17, 2022 3 hours ago, Behdadsoft said: Hi. I have a DBGrid on my form that contain many rows. the problem is that, scrollbar don't work normally like other programming language. I searched in google for find a solution for this issue but I couldn't find anything. for better understanding, I captured a video from C# DataGridView and Delphi DBGrid that the problem is obvious. Also I Use Delphi 11.1. Video: Compare C# and Delphi Scrollbar A TDBGrid is a kind of virtual grid. It shows rows from a dataset and does not know how many rows the dataset contains (the dataset itself may not know that, in fact). So it scrolls the active row in the dataset, not the rows in the grid; the selected row in the grid corresponds to the active record in the dataset. The grid actually contains only enough rows to fill the visible area, which get reused for new content as the dataset is scrolled. Share this post Link to post
Tom F 85 Posted April 17, 2022 See: . I didn't try it, but perhaps the solution by aehimself will work for you? I used the few lines of code from Uwe Raabe for smooth scrolling. 1 Share this post Link to post
Stano 143 Posted April 17, 2022 I don't know if it will be interesting for you. To avoid similar and different problems with DBGrid, I switched to TVirtualStringTree very quickly. About a week. And I was a beginner. I have no problems with TVirtualStringTree. For the same reasons, I left the DB components. Then I bought TMS components and after a while I went back to DB components. But TMS. Share this post Link to post
Attila Kovacs 631 Posted April 17, 2022 4 hours ago, Behdadsoft said: If you select a row in DBGrid and with moving scrollbar selected row changes it's normal? it should only scroll page to up or down and not change selection. Something that happens in C# and other. Well, Delphi was first not C#. With "the other" I can't deal. Anyway, I'd suggest you to hire a Delphi coder who can easily override the corresponding event handlers to let TDBGrid behave like you describe. (For whatever mystic reason) Share this post Link to post
Behdadsoft 0 Posted April 17, 2022 (edited) I found a solution for this issue. NextDBGrid6 Component form bergsoft is working like C# DataGridView. Edited April 18, 2022 by Behdadsoft Share this post Link to post