Hi,
I want to add a ComboBox at Cell Level in DataGrid. i. e. There is one Static ComboBox(Suppose A) in a Cell of DataGrid, upon Selecting a value of that Combo Box, there on Next cell a ComboBox(Suppose B) will generate dynamically. My Problem is that, on first Row of Grid B ComboBox Value Changes to The value Of Current Row(When Adding a Differrent Value on 2nd Row). My Dynamic ComboBox Generation Code is Following:
I want to add a ComboBox at Cell Level in DataGrid. i. e. There is one Static ComboBox(Suppose A) in a Cell of DataGrid, upon Selecting a value of that Combo Box, there on Next cell a ComboBox(Suppose B) will generate dynamically. My Problem is that, on first Row of Grid B ComboBox Value Changes to The value Of Current Row(When Adding a Differrent Value on 2nd Row). My Dynamic ComboBox Generation Code is Following:
VB.NET:
Private Sub dgvValue_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvValue.CellEndEdit
Select Case e.ColumnIndex
Case A
Dim dgvCboB As New DataGridViewComboBoxCell
DT_B = FetchDatatable(dgvValue(A, e.RowIndex).EditedFormattedValue)
dgvCboB.DataSource = DT_B
dgvCboB.DisplayMember = "Value Name"
dgvCboB.ValueMember = "GUID"
dgvCboB.AutoComplete = True
dgvValue(B, e.RowIndex) = dgvCboB
End Select
End Sub
Last edited: