Operation cannot be performed in this event handler

后端 未结 4 1787
日久生厌
日久生厌 2021-01-19 03:46

I\'m trying to delete a row from a DataGridView
I use two types of instuctions
A

VouchersDGV.Rows.Clear()

B



        
4条回答
  •  孤城傲影
    2021-01-19 04:06

    At the point of validation, it is relying on a particular state, and it obviously isn't happy for you to start changing the rows when it only asked you to validate something. I can't say I blame it; having to re-validate the scenario after every event would get... confusing; better to prevent the change.

    You could instead queue the item for removal, on a timer of another callback, or maybe there is a mechanism for saying "no" during validation.

提交回复
热议问题