How do I programmatically retreive data when saving the data in DataGrid?

G

Guest

How do I programmatically retreive data when saving the data in DataGrid

I use the DataTable in a for loop and programmatically save the data do the database.
I have the problem how to handle a deleted row?
 
C

Cor

Hi Daniel,

Are you sure it is a deleted row and not a removed row?

Tell something more how you "delete" the row, and what you use to update.

Cor
 
C

Cor

Hi Daniel,

I was thinking about that, I noticed that also just a short time ago.

As far as I can see is pushing the del key doing a remove.
A remove deletes a row totally from the datatable (acceptchanges is done for
that row).

That means that when you use that methode and do an update there is no
update and the row stays in the database.

I have seen no documentation on MSDN for that "del" key

I have searched internet also for a solution. The only solution I have seen
(and I do not know if it works) is to prevent to use the "del" key with an
API function.

The best thing you can do is making a del button on your form, how to
prevent that del key, I do not know (maybe I will search for it today).

However I think this can give very strange results.

But have also a look at this messages to dotnet newsgroups and the answers.

http://groups.google.com/groups?hl=...e+Search&meta=group=microsoft.public.dotnet.*

I know this is no answer, but I have no, maybe someone else knows it.
If you found one, please message it in this thread, than I know it also.

Cor
 
G

Guest

Thanks Cor

In the mean time I will have another array with the original items and make a check method if any rows have been deleted.
 
C

Cor

Hi Daniel,

This problem goes me to deep.

I tried the sample on syncfussion but did not work either as I did expected
(It can be I did make a mistake)

The way you do it now was something I also would do.

I did not try it complete, but I thought that you can catch it in the
deleting event from the datagrid.

You need for that this
\\\
AddHandler ds.Tables(0).RowDeleting, _
New DataRowChangeEventHandler(AddressOf Row_Deleting)
//
\\and this one
Private Sub Row_Deleting(ByVal sender As Object, ByVal e _
As DataRowChangeEventArgs)
End Sub
///

Cor

">
In the mean time I will have another array with the original items and
make a check method if any rows have been deleted.
 

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