Solved

Scrollbar and DBGrid

Posted on 2004-09-15
6
701 Views
Last Modified: 2010-04-04
Hi,

The question is quite simple, but not the answer i guess (not for me i mean): I want the scrollbar in a dbgrid doesn't move when i click on a record, and be able to move the scrollbar keeping the record that is selected, viewing the whole list in the dbgrid.

I hope have well explained, sorry my english.
0
Comment
Question by:ttrobin
6 Comments
 
LVL 6

Expert Comment

by:Amir Azhdari
ID: 12070354
Hi, try to work with these functions :

EnableScrollBar
GetScrollPos
GetScrollInfo
GetScrollRange
ScrollDC
ScrollWindow
ScrollWindowEx
SetScrollInfo
SetScrollPos
SetScrollRange
ShowScrollBar

Regards
Azhdari
0
 

Author Comment

by:ttrobin
ID: 12073714
hi Azhdari,

I have tried the functions u gave me, but they doesnt work the way i want. I can move the scrollbar to the position i want, but the dbgrid list doesnt scroll at the same time, and doesnt keep the focused record...

Thanx anyway but, someone else have any idea?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12073778
thats not so easy, just because if you scroll the
scrollbar the grid scrolls the dataset as well,
which causes that other records become currentrecord

my advice would be to use a bookmark as pointer
to your "currentrecord", then you can easily return
to your record with the gotobookmark-method

just as suggestion

meikl ;-)
0
 

Author Comment

by:ttrobin
ID: 12153028
Hi kretzschmar,

Bookmark doesnt work as i wish. Thnx anyway

Any help please!!! :)
0
 
LVL 2

Accepted Solution

by:
cula99 earned 125 total points
ID: 12471916
Hi,

try to set dbgrid.options.multiselect to true. With that your row will be selected all the time and you can scroll all dataset. If you need data from that record you'll have to find that one. Also put some variable to count number of selected records, maby then you can use bookmark to reatreve that particular record.

Cula
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now