Hi to everybody,
I need some help to solve a problem referred to a DataGridViewcomboBoxColumn.
a) I add a comboBoxColumn to a DataGridview as follows:
Dim column As New DataGridViewComboBoxColumn()
With column
.Name = "SELEZIONE COL"
.HeaderText = "SELEZIONE COL"
.DropDownWidth = 160
.Width = 90
.MaxDropDownItems = 4
.FlatStyle = FlatStyle.Flat
.DefaultCellStyle.SelectionBackColor = Color.Yellow
.AutoSizeMode = _
DataGridViewAutoSizeColumnMode.AllCells
.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
.Items.AddRange("Col5", "Col6", "Col8", "Col10", "Prezzo")
End With
Me.KryptonDataGridView1.Columns.Add(column)
b) Well then I add a dataSource to the DataGridView:
Me.KryptonDataGridView1.DataSource = Me.DtDataGrid (dataTable)
The items of the first DataGridViewComboBoxColumn are the HeaderText of the other columns or better the columns of the dataTable (DataSource).
My intention is allow to multiselect a choice (for each row of the DataGridView -col5,6,8 etc) and to get all details of the selected rows.
My problem: anytime one row is selected the previous ones get blank (without selection).
Help
I need some help to solve a problem referred to a DataGridViewcomboBoxColumn.
a) I add a comboBoxColumn to a DataGridview as follows:
Dim column As New DataGridViewComboBoxColumn()
With column
.Name = "SELEZIONE COL"
.HeaderText = "SELEZIONE COL"
.DropDownWidth = 160
.Width = 90
.MaxDropDownItems = 4
.FlatStyle = FlatStyle.Flat
.DefaultCellStyle.SelectionBackColor = Color.Yellow
.AutoSizeMode = _
DataGridViewAutoSizeColumnMode.AllCells
.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
.Items.AddRange("Col5", "Col6", "Col8", "Col10", "Prezzo")
End With
Me.KryptonDataGridView1.Columns.Add(column)
b) Well then I add a dataSource to the DataGridView:
Me.KryptonDataGridView1.DataSource = Me.DtDataGrid (dataTable)
The items of the first DataGridViewComboBoxColumn are the HeaderText of the other columns or better the columns of the dataTable (DataSource).
My intention is allow to multiselect a choice (for each row of the DataGridView -col5,6,8 etc) and to get all details of the selected rows.
My problem: anytime one row is selected the previous ones get blank (without selection).
Help