开发者

BindingSource CurrentChanged/PositionChanged old item

开发者 https://www.devze.com 2023-02-24 22:23 出处:网络
Is there a way to get a notification before Current of a BindingSource changes in Windows Forms, including the old item?

Is there a way to get a notification before Current of a BindingSource changes in Windows Forms, including the old item?

I'd like to save the old element before navigating away. CurrentChanged and PositionChanges both are EventHa开发者_高级运维ndler events and do not provide a reference to the old item.

It is not that important to get notified before the position changes, but it is critical to get the old item.

Cheers Matthias


store it yourself ...

everytime Current changes you are notified by the event...

if you have a reference that is updated at the end of your eventhandler (store reference to current item) you can look at this reference when the event handler runs again ... when you look at it before it is updated, it will refer to the old item

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号