Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBGrid Scroll Bar problem

Status
Not open for further replies.

MLNorton

Programmer
Nov 15, 2009
134
US
I have a DBgrid that works differently in different programs.

In one program the scroll bar can be dragged smoothly and the grid scrolls. His is what I desire and expect.

In the other program, when you drag the scroll bar, the grid does not scroll and the scroll bar jumps back to the top when released. When you click in the scroll region, not the scroll bar, the scroll bar jumps to the middle and the grid scrolls one record.

How can this be corrected?
 
well that depends on your datasource.
if you are using dynamic acces (keyset=ctDynamic and location = clUseServer) then the Grid does not load all the data at once and hence it does not know how data it contains. So in that case the scrollbar is only used for page scrolling.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Both databases are Access 2010. The larger one, 2,300 records, works correctly. The one that has the problem only has 250 records.
 
It does not depend on the database, but how you are accessing it.
What db components are you using?

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
check the CursorLocation property on your ADOConnection and ADOTable...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Cursor Location = dUserClient
Cursor Type = ctStatic
in all of my prpgrams.
 
please show the DFM contents of the file that contains the TADOTable and TADOConnection.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
object Form_Display: TForm_Display
Left = 0
Top = 0
Caption = 'Rolodex Input'
ClientHeight = 564
ClientWidth = 761
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
OnActivate = FormActivate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Label_Heading: TLabel
Left = 16
Top = 8
Width = 760
Height = 33
Alignment = taCenter
AutoSize = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlue
Font.Height = -24
Font.Name = 'Tahoma'
Font.Style = [fsBold, fsItalic]
ParentFont = False
end
object Label_Title: TLabel
Left = 349
Top = 65
Width = 38
Height = 19
Caption = 'Title'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlue
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
object Label_Records: TLabel
Left = 47
Top = 523
Width = 193
Height = 25
AutoSize = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
object Label_Search: TLabel
Left = 55
Top = 67
Width = 50
Height = 16
Caption = 'Search:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
object DBGrid1: TDBGrid
Left = 47
Top = 89
Width = 233
Height = 425
Color = clMenu
DataSource = DataSource1
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
OnCellClick = DBGrid1CellClick
Columns = <
item
Expanded = False
FieldName = 'Title'
Title.Alignment = taCenter
Title.Caption = 'Name'
Title.Font.Charset = DEFAULT_CHARSET
Title.Font.Color = clWindowText
Title.Font.Height = -16
Title.Font.Name = 'Tahoma'
Title.Font.Style = [fsBold]
Width = 298
Visible = True
end>
end
object Button_Close: TButton
Left = 464
Top = 520
Width = 75
Height = 25
Caption = 'Close'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
OnClick = Button_CloseClick
end
object Button_New: TButton
Left = 246
Top = 520
Width = 75
Height = 25
Caption = 'New'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 3
OnClick = Button_NewClick
end
object DBEdit_Title: TDBEdit
Left = 408
Top = 62
Width = 273
Height = 27
DataField = 'Title'
DataSource = DataSource1
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlue
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
end
object Memo1: TMemo
Left = 303
Top = 47
Width = 402
Height = 458
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = [fsBold]
Lines.Strings = (
'')
ParentFont = False
TabOrder = 4
end
object Edit_Search: TEdit
Left = 119
Top = 62
Width = 121
Height = 24
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 5
OnChange = Edit_SearchChange
end
object ADOConnection1: TADOConnection
Connected = True
ConnectionString =
'Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=D:\Ca' +
'rds\Rolodex.mdb;Mode=Share Deny None;Persist Security Info=False' +
';Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLE' +
'DB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Databa' +
'se Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:' +
'Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Je' +
't OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=' +
'False;Jet OLEDB:Don'#39't Copy Locale on Compact=False;Jet OLEDB:Com' +
'pact Without Replica Repair=False;Jet OLEDB:SFP=False'
LoginPrompt = False
Mode = cmShareDenyNone
Provider = 'Microsoft.Jet.OLEDB.4.0'
Left = 712
Top = 511
end
object ADOTable1: TADOTable
Active = True
Connection = ADOConnection1
CursorType = ctStatic
Filter = 'Standard = '#39'X'#39
Filtered = True
TableName = 'RolodexCards'
Left = 672
Top = 511
end
object DataSource1: TDataSource
DataSet = ADOTable1
Left = 640
Top = 511
end
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top