Board index » delphi » DBGrid's Vertical Scrollbar problem

DBGrid's Vertical Scrollbar problem

Hi !

I would like to make DBGrid's Vertical ScrollBar really active.

I mean that if you hold down left mouse button on Vertical ScrollBar's
Button and move mouse UP/DOWN, DBGrid shoud make a refresh (should show
new items).
In the standard DBGrid is that not possible.

Does anyone know how can i achieve that ?  Any example would be great !
Is it maybe already written such DBGrid component ?

Please, help on e-mail:  iko...@amis.net

Thanks,
Iztok

 

Re:DBGrid's Vertical Scrollbar problem


Iztok,

The reason the scrollbar doesn't work correctly in Delphi's DBGrid
is because most SQL databases don't have any concept of 'record
numbers'; it would be impossible to have the thumb accurately
position itself inside the scrollbar. So Borland decided to show
only three locations: top of the file, bottom of the file, and
somewhere in between.

I believe InfoPower has a grid that implements the correct
scrollbar behavior for databases that support them. You might
also look at Luxent's DBPower collection, as it has a grid with
correct scrollbar behavior for Paradox and dBase file types.

HTH

Ken
--
Ken White
kwh...@westelcom.com

Clipper Functions for Delphi
http://members.aol.com/clipfunc/

Quote
Iztok Kovac wrote:

> Hi !

> I would like to make DBGrid's Vertical ScrollBar really active.

> I mean that if you hold down left mouse button on Vertical ScrollBar's
> Button and move mouse UP/DOWN, DBGrid shoud make a refresh (should show
> new items).
> In the standard DBGrid is that not possible.

> Does anyone know how can i achieve that ?  Any example would be great !
> Is it maybe already written such DBGrid component ?

> Please, help on e-mail:  iko...@amis.net

> Thanks,
> Iztok

Re:DBGrid's Vertical Scrollbar problem


In article <35884B20.C29E...@westelcom.com>,
  Ken White <kwh...@westelcom.com> wrote:

Quote
> The reason the scrollbar doesn't work correctly in Delphi's DBGrid
> is because most SQL databases don't have any concept of 'record
> numbers'; it would be impossible to have the thumb accurately
> position itself inside the scrollbar. So Borland decided to show
> only three locations: top of the file, bottom of the file, and
> somewhere in between.

select count(*) from tablename

To accurately size a scrollbar, we only need the logical number of records in
the current dataset, not record numbers.  Seems like an oversight to me.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:DBGrid's Vertical Scrollbar problem


Quote
In article <6oemr0$mk...@nnrp1.dejanews.com>, papa...@my-dejanews.com wrote:
>In article <35884B20.C29E...@westelcom.com>,
>  Ken White <kwh...@westelcom.com> wrote:

>> The reason the scrollbar doesn't work correctly in Delphi's DBGrid
>> is because most SQL databases don't have any concept of 'record
>> numbers'; it would be impossible to have the thumb accurately
>> position itself inside the scrollbar. So Borland decided to show
>> only three locations: top of the file, bottom of the file, and
>> somewhere in between.

>select count(*) from tablename

>To accurately size a scrollbar, we only need the logical number of records in
>the current dataset, not record numbers.  Seems like an oversight to me.

I don't think so. If you are working client server, the CLIENT has to
calculate the number of records, meaning the clinet has te fetch ALL the
records from the server and not the 30 it has to show. This can take a hell of
time.

I'm having the same problem with a locate statement. The client has to locate
the record, but it first have to read ALL the records in the query from the
server.

The Graphical Gnome (r...@ktibv.nl)
Sr. Software Engineer IT Department
-----------------------------------------
The Unofficial Delphi Developers FAQ
http://www.gnomehome.demon.nl/uddf/index.htm

Other Threads