开发者

List View Item Deleting parameters not passed to Object Data source

开发者 https://www.devze.com 2023-03-08 10:36 出处:网络
I have a ListView b开发者_如何学Pythonound to an ObjectDataSource, I\'m passing some custom parameters to the Insert and Update methods on my bound class methods by adding them to the event.Values map

I have a ListView b开发者_如何学Pythonound to an ObjectDataSource, I'm passing some custom parameters to the Insert and Update methods on my bound class methods by adding them to the event.Values map in the ListView ItemInserting/ItemUpdating events.

However when I try to do the same thing on the ItemDeletingEvent the additional parameters do not seem to be passed to the datasource ( If I register a listener for ObjectDataSource.ItemSourceDeleting I only see one parameter, effectively the 'id' of the row).

Is this an expected behavior? I can't see anything in the documentation that indicates as such.


I found a solution -

I Added a 'DeleteParameter' value with the same name as my desired 'custom' parameter to the ObjectDataSource declaration.

Then in the ItemDeleting Event get the ObjectDataSource.DeleteParameters["myparam"] and set the DefaultValue property. Seems like a hack, but it does work.

0

精彩评论

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