[VB.NET]datagrid索引的问题谁有好方法

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

猜你在找的VB相关文章