【发布时间】:2020-01-23 09:52:05
【问题描述】:
我在我的 erp 中使用 datagridview,但我的一位新客户要求我使用 devexpress
现在在datagridview中我使用如下代码
Dim items As Boolean = False
For Each row In DataGridView1.Rows
If TextBox1.Text = row.Cells("Barcode").Value Then
items = True
Exit For
End If
Next
在“对于 DataGridView1.Rows 中的每一行”行中 我无法在 devexpress gridcontrol 中编写此代码。 我怎么能做到我的意思是我怎么能写出像“gridview.rows”这样的代码
我的完整代码是我想更改为 DEVEXPRESS --- GRIDVIEW
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then
Dim items As Boolean = False
' For Each row In DATAGRIDVIEW.ROW
If DebitaccountTextEdit.Text = row.Cells("Barcode").Value Then
items = True
Exit For
End If
Next
If items = False Then
DataGridView1.Rows.Add(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text)
MessageBox.Show(Me, "Item Added to List", "System Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
Else
MessageBox.Show(Me, "Item Already Added", "System Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End If
【问题讨论】: