前端之家收集整理的这篇文章主要介绍了
[VB.NET]datagrid索引的问题谁有好方法,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
datagrid索引的问题谁有好
方法 索引老是不同步,见鬼了,这算那门子事 If DataGrid1.CurrentRowIndex <> -1 Then
获取当前行并进行
修改 Dim iRow As Integer = DataGrid1.CurrentRowIndex.ToString With itemoutlist .Rows(iRow)( 品名 ) = Me.Combo
Box1.Text.Trim .Rows(iRow)( 规格 ) = Me.Text
Box1.Text.Trim .Rows(iRow)( 领取
数量 ) = Me.Text
Box3.Text.Trim .Rows(iRow)( 单位 ) = Me.Text
Box4.Text.Trim .Rows(iRow)( 仓库 ) = Me.Combo
Box2.Text.Trim .Rows(iRow)( 领料日期 ) = Me.DateTimePicker1.Text.ToString .Rows(iRow)( 领料员 ) = Me.Text
Box5.Text.Trim End With End If Catch Message
Box.Show( 数据
错误 ) End Try __________________________________________________________________________ If Me.DataGridView1.SelectedRows.Count = 1 Then With Me.DataGridView1.SelectedRows(0) .Cells(0).Value = Me.Combo
Box1.Text.Trim .Cells(1).Value = Me.Text
Box1.Text.Trim End With End If 这样试验一下看看 __________________________________________________________________________ 呵呵,谢谢.我已经
解决了,我
代码没错,只不过用错事件了. __________________________________________________________________________ 那还不结贴? __________________________________________________________________________