?
Solved

Scrollbar and DBGrid

Posted on 2004-09-15
6
Medium Priority
?
709 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 375 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

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