Reputation: 1659
I have an "odd" situation. I've got a form with a binding source and a binding navigator. In this instance, I've got 161 records (via EF6) to display. The databinding to the controls works nicely. But what I find is that the expected events for the binding navigator don't happen consistently. Then they settle down.
I've got event handlers (additional to the default ones, but the same thing happens when I remove the default ones as well)
I set the binding source one the navigator, and the "Position Changed" event is raised (as I'd expect)
Clicking on any of the "Move" buttons, or editing the position field will result in: No event being raised (not the item click events, not the binding source Position Changed) roughly 3 out of 4 times. Then the event raises, all the expected navigation occurs, and repeat.
But it doesn't seem to be permanent, because after a while almost all the records have the navigation all starts working properly. This happens with and without the debugger connected.
The other thing I notice is that when it fails, the icon in the taskbar flashes once.
It's not something in any of my handler code, because it never gets to my code. It might be a property setting. It's not an exception, because even with "break on all exceptions", no exception is reported.
Upvotes: 0
Views: 929
Reputation: 5380
When you talk about "move" buttons, I take it that you mean the next/previous record navigation buttons on the BindingNavigator
. Those buttons are not full-fledged Windows controls, but rather they are "lightweight" controls. I've seen issues in the past because of this.
While I do not have all the details fresh in memory, it had to do with the fact that they don't steal the focus away from other controls as regular Windows controls do, and this caused some events to not be raised.
I suggest you create your own navigation buttons, which is what I ended up doing on all my Windows Forms project. Those regular buttons can then call the BindingSource
methods such as MoveNext
and so on.
Upvotes: 1