Where is BindingNavigator automatic code?

FreeriderUK

Well-known member
Joined
Jun 27, 2006
Messages
100
Location
London
Programming Experience
10+
I am trying to prevent users from deleting the last row in a table, but cannot find the code for the Delete button in BindingNav.

Anyone know where the code is? (Not the Designer Generated Code)

Or maybe there's something in the SQL database to prevent it?
 
The BindingNagivator has the DeleteItem assigned to a toolstrip button, that when clicked makes bindingnavigator call its bindingsource.RemoveCurrent. You can remove the link to DeleteItem, doubleclick the toolstrip delete button and write the code to do conditional remove.
 
That is correct.
 
Thanks JohnH, that works great.
Are you saying there is no "hidden code"?

Well, there is, but it's compiled into BIndingNavigator. You cannot edit that code, you can only remove the association BN has with a DeleteItem, and then take that item's click handler and roll your own..
 
I agree there is always code somewhere, but thought the question was about if there was "Designer generated code" in relation to this or not, which there isn't, it's just the link/reference to that button that when clicked cause the navigator to trigger.
 
Back
Top