I have an app that comprises a DB Grid and a DBNavigator. The app is
essentially a 'log' based on a timestamp key field.
With D5 pro and using a DBNavigator I need to append a new record rather
than inserting one (simply because I need visually for the cursor/record to
go to/at the end of the log).
The DBNav does not have an append button so how can one add one or over-ride
the existing Insert key (and associated hint) to perform this function?
Regards,
procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
begin
if (Button = nbInsert) then
begin
Table.Append;
end;
end;
Best Regards
Kittipong Kiatcheeranun
"Tony" <pols...@yahoo.com> wrote in message
news:434a...@newsgroups.borland.com...
I had considered this approach but wondered if it would over-ride the
standard DS.Insert or the DS.Insert would fire followed by the DS.Append -
and the consequencies thereof.
Regards,
Tony
"Kittipong Kiatcheeranun" <kk_t...@hotmail.com> wrote in message
You can override BtnClick method in DBNavigator class too. If you have a
look in TDBNavigator class
the BtnClick procedure is virtual method declaring in the public section.
Have a look at TDBNavigator class in DBCtrls.pas, you will get an idea. :)
Regards
Kittipong Kiatcheeranun
Tony, I am a little concerned that you may be misusing the
concept of a database table. Only a few table types will
allow you to specify the logical position of the new record
by means other than the sort order of its contents, relative
to what is already in the table. If you want to specify the
position of a new record in a TDBGrid before and after its
posting, then I suggest that you research other methods
beyond Append and Insert. Regards, JohnH
Hi John,
The application is a data logging one (grid type) with the primary key the
date and time of entry (i.e. Timestamp). 'Logically' (if there is such a
thing) the operator needs to add the latest entry at the end of the log. If
one 'hits' 'Last' one goes to the end of the grid (last record) but hitting
Insert inserts the new record prior to the previous entry - which is
disconcerting to the user (and me!). OK, so one could hit the down arrow key
to achieve the same result and even if one does issue an insert, refresh
will sort out the grid 'appearance'.
In reality all I'm trying to do is make the grid 'list' look normal - new
entries are added to the end, just like a manual data 'record book'. I'm
dealing with fairly non-computer literate users (and myself as casual
programmer!)
BTW, I'm using Firebird as the DB.
However, thanks for the concern shown, it is appreciated.