こんにちは、図のようにグリッド ビューで次の操作を実行したいと思います。品目コンボボックスから品目を選択すると、単価テキストフィールドに単価が生成されます。Product テーブルでバインドされたアイテム コンボ ボックスのデータ。Item コンボ ボックスの値メンバは Product フィールドの Unitprice です。PLZが助けてくれます。事前にサンクス。
質問する
1447 次
1 に答える
0
CellValueChanged
のイベントを処理したいDataGridView
。
Private Sub CellValueChanged(ByVal sender As Object, _
ByVal e As DataGridViewCellEventArgs) _
Handles DataGridView1.CellValueChanged
' Update the unit price column whenever the value of the item cell changes.
If DataGridView1.Item(e.ColumnIndex, e.RowIndex) == DataGridView1.Item("Item", e.RowIndex) Then
DataGridView1.Item("Unit Price", e.RowIndex).Value = DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value
End Sub
MSDNのDataGridView.CellValueChanged
イベント リファレンスおよび MSDNのDataGridViewComboBoxCell
クラス リファレンスの「備考」セクションも参照してください。
于 2013-02-24T02:59:24.970 に答える