简单问题,关于DataGrid控件(VB.NET)。
我在DataGrid控件的每行绑定了“编译”按钮,在UpdateCommand事件下修改被选中的记录:
“strID”为获得主键的值(断点调试,已经获得)
Dim strID As String = MyDataGrid.DataKeys(e.Item.ItemIndex)
然后获得每列的值时:
Dim strName As String = CType(e.Item.Cells(1).Controls(0),TextBox).Text
报错了,说:指定的转换无效!
请问我该怎么改,我是菜鸟,请多关照。