Solved

Scrollbar and DBGrid

Posted on 2004-09-15
6
708 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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