Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 30th, 2007, 11:38 PM
steve6341 steve6341 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 61 steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 52 sec
Reputation Power: 10
DBGrid and disappearing scrollbar

This is a stupid question which I'm almost positive has a simple answer, but I can't figure it out. I am using 3 DBGrid components with corresponding datasource components tied to KADaoTable components. The 3 tables are joined together MasterSource/MasterFields. (They display artist, album, track information) You can click an artist, which filters the list of albums to show only those by that artist, then click an album and see the tracks in the third grid on that album. Simple stuff. The problem is sometimes (and I can't find the pattern) the vertical scroll bar on the right side of the DBGrid component is not displayed on the album and/or the track grid. You can press the down arrow key and scroll to the additional albums or tracks. Or, you can randomly click around to different albums/artists and the scroll bars will magically come back. Not 100% sure but I think is related to the KADao components. Any help would be great. Thanks!

Reply With Quote
  #2  
Old July 1st, 2007, 12:58 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
I have no experience of KADaoTable.

My guess is it has to do with how many rows the DBGrid thinks are in the result set.
If it assumes only, or less than, the available rows in the grid it will hide the scrollbar.
Once you scroll down I presume more rows are fetched and the result set count gets larger.

See if KADaoTable lets you set the number or rows retrieved or something along those lines.

Clive

Reply With Quote
  #3  
Old July 1st, 2007, 10:24 PM
steve6341 steve6341 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 61 steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 52 sec
Reputation Power: 10
A couple of things I have found...

I am able to get the number of records in the result set. I find it with KADaoTable->RecordCount. Unfortunately, the number it reports is always correct, although the scroll bar is not always present. I don't know what this means. The DBGrid component seems to display the scroll bar when the result set contains any more than one record. Even though I have more than enough room for 10+ records, the scroll bar shows if the result set contains only 2 records. It also seems as though the scroll bar disappears on the next record set following a result set of one. In other words- If you select an artist that has only one album, the DBGrib for albums will not display a scroll bar (This is OK). If the next artist has 15 albums, the scroll bar will not come back (Not what I want). (This seems trivial since most artists do not have 15 albums but I am having the same problem listing tracks on an album- the scroll bar is sometimes absent and you can't really tell if there are more tracks on an album without pressing down arrow) If you click another artist with only one album, then another artist with multiple albums, the scroll bar will come back until you hit another single-album artist. I have tried several procedures on DBGrid like DBGrid->Refresh() and DBGrid->Update(). They do not help.

I hope this indicates something to someone out there. I would really like to get this working.

Thanks

Reply With Quote
  #4  
Old July 2nd, 2007, 12:53 AM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Which version of Delphi?

Reply With Quote
  #5  
Old July 2nd, 2007, 07:31 AM
steve6341 steve6341 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 61 steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 52 sec
Reputation Power: 10
Its C++ Builder 6.

Reply With Quote
  #6  
Old July 2nd, 2007, 04:13 PM
steve6341 steve6341 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 61 steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 52 sec
Reputation Power: 10
More info...

It works fine on Windows 2000 machines. The problem is only on Windows XP.

Reply With Quote
  #7  
Old July 2nd, 2007, 10:22 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
Originally Posted by steve6341
More info...

It works fine on Windows 2000 machines. The problem is only on Windows XP.

I have seen some comments elsewhere to the same effect and that it is a problem with Delphi6 (at least) and XP.

One suggestion I saw (slightly modified by me).

In the AfterScroll event of the parent Dataset add these two lines.

ChildDBGrid.Width := ChildDBGrid.Width +1;
ChildDBGrid.Width := ChildDBGrid.Width - 1;

I have no idea if it will work.

Clive.

Reply With Quote
  #8  
Old July 2nd, 2007, 11:31 PM
steve6341 steve6341 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 61 steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level)steve6341 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 52 sec
Reputation Power: 10
Clive- That is great!
That works as a great workaround. This will fix a similar problem I have in 2 other apps. I can't thank you enough. I really appeciate you repeatedly following up with this thread. Thanks.

Steve

Reply With Quote
  #9  
Old March 14th, 2013, 05:29 AM
IanBurrows IanBurrows is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 1 IanBurrows User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 42 sec
Reputation Power: 0
Great fix thanks this helped me too.


ParamVDBGridWithTextValue.Width := ParamVDBGridWithTextValue.Width + 1; // Show Vertical Scroll bar
ParamVDBGridWithTextValue.Width := ParamVDBGridWithTextValue.Width + 1;

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > DBGrid and disappearing scrollbar

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap