Board index » delphi » Adding a row with a TDBGrid?

Adding a row with a TDBGrid?

I must be missing something...

I'm using the TDBNavigator with a TDBGrid.  I add a row to the grid, edit
several columns and then click on another row.  The grid seems to move the
row I was just adding to the row that I just clicked on.  This can't be the
normal behavior and someone else must have ran into this.  Any suggestions?

thanks,
Darcy,  

 

Re:Adding a row with a TDBGrid?


Quote
In article <50ikrb$...@nr1.vancouver.istar.net>, "Darcy Schultz" <dschu...@spots.ab.ca> wrote:
>I must be missing something...

>I'm using the TDBNavigator with a TDBGrid.  I add a row to the grid, edit
>several columns and then click on another row.  The grid seems to move the
>row I was just adding to the row that I just clicked on.  This can't be the
>normal behavior and someone else must have ran into this.  Any suggestions?

>thanks,
>Darcy,  

Just a guess, but what you may be seeing is the record being inserted into
it's proper index order.  When you{*word*128}insert the record, the fields are
blank.  When you post (as by clicking on another row) it goes to it's
rightfull place.

Ed

-----
Ed Hochman - MBH Systems - e...@mbhsys.com

Re:Adding a row with a TDBGrid?


Is the underlying datasource a table?  If so, what is its sort order?  =
Its possible you are changing a key value, and the table is sorting =
after the post.

--=20
Mark

Darcy Schultz <dschu...@spots.ab.ca> wrote in article =
<50ikrb$...@nr1.vancouver.istar.net>...

Quote
> I must be missing something...
>=20
> I'm using the TDBNavigator with a TDBGrid.  I add a row to the grid, =
edit
> several columns and then click on another row.  The grid seems to move =
the
> row I was just adding to the row that I just clicked on.  This can't =
be the
> normal behavior and someone else must have ran into this.  Any =
suggestions?
>=20
> thanks,
> Darcy, =20

Re:Adding a row with a TDBGrid?


Quote
"Darcy Schultz" <dschu...@spots.ab.ca> wrote:
>I must be missing something...
>I'm using the TDBNavigator with a TDBGrid.  I add a row to the grid, edit
>several columns and then click on another row.  The grid seems to move the
>row I was just adding to the row that I just clicked on.  This can't be the
>normal behavior and someone else must have ran into this.  Any suggestions?
>thanks,
>Darcy,  

Darcy,

The most probable reason is that the underlying table has a primary
index and every record when posted goes to it's assigned location;
either alphabetically or numerically according to the key field.

That might account for what you've seen.

Good luck.

Mike Metcalf
Acacia Computer Consulting

Other Threads