How to get a forms datagrid to do "everything one expects"?

  • Thread starter sherifffruitfly
  • Start date
S

sherifffruitfly

Hi all,

I'm fine with getting the grid to *display* data - it's everything
else that I'm sketchy on.

In particular, "everything one expects" refers to:

(1) When a row in the datagrid is deleted, the database record is
deleted.
(2) When a new row in the datagrid is added & populated, a record is
added to the database.
(3) When an existing row in the datagrid is edited, the corresponding
record in the database is updated.

Does all of this have to be manually coded up? Are is there an
automatic way to get all of this?

I'm sure this has been answered a jillion times in the past - just a
link is sufficient.

Thanks,

cdj
 
O

OD

This is not a so simple problem.
There is a big difference between "old" client/server way and the
disconnected way used by dotnet.
Want you want is that your grid acts the same way as in client/server
mode, each action is propagated to the database, immediately.

Unfortunately I found no simple answer to this problem. "simple" = with
no code.
In a project I wrote, the only way I found was to add a 'detail'
section under the grid, no update can be made in the grid directly and
must be done in the detail section. When any field in modified in the
detail section I locked the grid and display two buttons
"save"/"cancel". When "save" is clicked I send an SQL update to the Db
and unlock the grid ('cancel' just reload the detail and unlock the
grid) ...

If someone has a better answer using only the grid...
 
S

sherifffruitfly

This is not a so simple problem.
There is a big difference between "old" client/server way and the
disconnected way used by dotnet.
Want you want is that your grid acts the same way as in client/server
mode, each action is propagated to the database, immediately.

Unfortunately I found no simple answer to this problem. "simple" = with
no code.
In a project I wrote, the only way I found was to add a 'detail'
section under the grid, no update can be made in the grid directly and
must be done in the detail section. When any field in modified in the
detail section I locked the grid and display two buttons
"save"/"cancel". When "save" is clicked I send an SQL update to the Db
and unlock the grid ('cancel' just reload the detail and unlock the
grid) ...

If someone has a better answer using only the grid...

To satisfy me, an answer doesn't need to be simple, only the simplest
*available* :)

An answer just suggesting which events to hook-up db methods to would
satisfy me.


Thanks,

cdj
 
O

OD

To satisfy me, an answer doesn't need to be simple, only the simplest
*available* :)

I'll take it too :)
An answer just suggesting which events to hook-up db methods to would
satisfy me.

If you find some, come back here to tell us the story :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top