本文介绍了在datagridview中发现组合框的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我有一个带1个组合框和2个文本框的datagridview
我希望当用户更新组合框时,程序会填充第一个文本框.
我有用于验证的代码,但我不知道如何获取组合框的值
Hi to all
I have a datagridview with 1 combobox and 2 textbox
i want when the user update the combobox the program fill the first textbox.
I have the code for validation but i dont know how to take the value of the combobox
Private Sub dataGridView1_CellValidating(ByVal sender As Object, ByVal e As DataGridViewCellValidatingEventArgs) Handles Movement_roller_DDataGridView.CellValidating
Dim headerText As String = _
Movement_roller_DDataGridView.Columns(e.ColumnIndex).HeaderText
' Abort validation if cell is not in the CompanyName column.
If Not headerText.Equals("Κωδικος Roller") Then Return
' Confirm that the cell is not empty.
If (String.IsNullOrEmpty(e.FormattedValue.ToString())) Then
Movement_roller_DDataGridView.Rows(e.RowIndex).ErrorText = "Ο Κωδικώς Roller δεν μπορεί να είναι κενός"
e.Cancel = True
End If
End Sub
推荐答案
这篇关于在datagridview中发现组合框的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!