all groups > dotnet windows forms databinding > october 2006 >
You're in the

dotnet windows forms databinding

group:

how to control Delete Method?


how to control Delete Method? Duong Nguyen
10/26/2006 6:45:14 PM
dotnet windows forms databinding: Hello!
I have 2 tables Products (ProductID,ProductName, Del) and Sale(id,
productID, qty, price)
Del setted to 1 if user deletes this product.
I have DataGridView and a BindingNavigator which binds to this table.
How can I control the Delete Method of the productsBindingSource everytime
when use tries to delete some product. Because row only is deleted logically
(set Del = 1), so I want to check if there is this product in the table
Sale, if there is- then not allow to delete this product from table Product
and vice verse.
Thanks in advance!

Re: how to control Delete Method? Bart Mermuys
10/26/2006 8:48:30 PM
Hi,

[quoted text, click to view]

Doubt there is anything build in. You probely gonna have to disconnect the
Delete button (see BindingNavigator properties) and then add your own
handler for the delete button, do the processing and then manually delete
the row using the BindingSource.

HTH,
Greetings


[quoted text, click to view]

Re: how to control Delete Method? Duong Nguyen
10/29/2006 6:32:34 PM
Ok, thank you very much. It works ok now.


[quoted text, click to view]

AddThis Social Bookmark Button