Index was out of range. Must be non-negative and less than the size of the collection

前端 未结 1 1791
旧时难觅i
旧时难觅i 2020-12-19 20:30

I get the index out of range exception when compiling my grid view to display a set of orders.

It doesn\'t happen when I add a new row but it does occur when I try t

相关标签:
1条回答
  • 2020-12-19 21:15

    You are not setting the name of the data key for the Grid, but your delete method references DataKeys[e.RowIndex]. I think that's where the exception gets thrown.

    Set DataKeyNames="OrderId" in your mark-up.

    0 讨论(0)
提交回复
热议问题