🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.databases
Article #28

Help: Jumping panels/rows in DBCtrlGrid/DBGrid at TQuery.Close+Open+Locate

#28
From: Fleshpipe
Date: Tue, 02 Jun 1998 00:00
50 lines
2881 bytes


Hi,
Are there anyone of you who happens to know if it is
possible to control which row/col/cell will correspond
to a certain PanelIndex in DBCtrlGrid ?

My problem is, since I have a DBCtrlGrid connected to a Query
(I must sort my records on a character field, and the damn
TTable.IndexFieldNames results in duplicated/unordered records),
and since a Query does not support the refresh method (at least
it says that "table does not support the operation because it is
not uniquely indexed" even though the table I query has a primary
key) I must do Close & Open every time I want to refresh my data.
I want the same cell in the CtrlGrid to be selected both before
and after the Close/Open part though. As it is now, when a cell
is selected I save the DB-search-value, I do Close/Open and then
I search on the saved value as in the following code:

  myQuery.DisableControls;
  lastIx := qryOrderedCraneStatus['CRANE_ID'];
  myQuery.Close;
  myQuery.Open;
  myQuery.Locate('CRANE_ID', lastIx, [loCaseInsensitive]);
  myQuery.EnableControls;

The same record is selected after the operation, but the PanelIndex
row/col location is different depending on what it was before the
operation.

Is there a way to connect/scroll current record or PanelIndex to a
certain row/column (I use 4x3 in my DBCtrlGrid); alt. is there a
way to refresh the dataset in a TQuery without Close/Open and
without changing the database server; alt. is there a way to
order the records in a TTable without getting duplicates
(workaround the bug) ?

There is a similar problem with TDBGrid (current/selected row jumps
up or down some positions every time a Close-Open-Locate is done).

I have struggled with this problem for 3 months now. Hysteria !
I'm using Delphi 3 on a P133/NT4.

Thanks in advance
/Mickey W


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading
Technical Details
Message-ID: <6l0qco$8qv$1@nnrp1.dejanews.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108890,6ca1e8fbd69f5345,start
X-Google-Attributes: gid108890,public
X-Google-Thread: ffff5,6ca1e8fbd69f5345,start
X-Google-Attributes: gidffff5,public
X-Google-Thread: 10baee,6ca1e8fbd69f5345,start
X-Google-Attributes: gid10baee,public
X-Google-Thread: 115d96,6ca1e8fbd69f5345,start
X-Google-Attributes: gid115d96,public
From: Fleshpipe@hotmail.com
Subject: Help: Jumping panels/rows in DBCtrlGrid/DBGrid at TQuery.Close+Open+Locate
Date: 1998/06/02
Message-ID: <6l0qco$8qv$1@nnrp1.dejanews.com>
X-Deja-AN: 358760954
X-Http-User-Agent: Mozilla/4.04 [en] (WinNT; I)
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Tue Jun 02 12:15:20 1998 GMT
Newsgroups: comp.lang.pascal.delphi.databases,comp.lang.pascal.delphi.misc,comp.lang.pascal.delphi.components,borland.public.delphi.database