假設我有數據網格下面:刷新DataGridViewTextBoxColumn當用戶點擊DataGridViewComboBoxColumn
第一列是DataGridViewComboBoxColumn。當用戶單擊組合框中的一個產品時,我想要列DataGridViewTextBoxColumn這是列價格要刷新或更新由組合框的選擇更改觸發。
下面是我的普通文本框的代碼。我如何刷新DataGridViewTextBoxColumn?
Private Sub refresh_grid(ByVal productOrder As String)
Dim mysql As String = "SELECT FLD_PRODUCT_PRICE FROM TBL_PRODUCTS "
Dim mydatatable As New DataTable
Dim myreader As New OleDb.OleDbDataAdapter(mysql, myconnection)
myreader.Fill(mydatatable)
Price = mydatatable.Rows(0).Item("FLD_PRODUCT_PRICE")
End Sub
'DataGridView.CellValueChanged Event' [從MSDN(https://msdn.microsoft.com/en-us/library/system .windows.forms.datagridview.cellvaluechanged(v = vs.110).aspx) – Fabio