为什么带按钮的dbgrid在分页后,选择下一页时会出错?
我定义了一个dbgrid, 填加了一个超链接式样的选择按钮,用来选取dbgrid中的一行,在页面的最初打开时dbgrid显示的数据都是正确的,按钮也正确,但是只要一按分页按钮想看下一页时,程序就出错了。
错误码如下:
Specified argument was out of the range of valid values. Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index
Source Error:
Line 88: ' clicked.
Line 89: Dim ID As String
Line 90: If (e.CommandName = "选取") Then
Line 91: ID = e.Item.Cells.Item(1).Text
Line 92: MessageBox.Show(ID, "sdkljkdf",