Hello everyone,
Greetings from Brazil! Please help! I have a DataGridView in a windows form with three columns:
Column1 is TipoComboBoxColumn
Column2 is QuantidadeColumn
Column3 is SementeComboBoxColumn
I need the SementeComboBoxColumn to display values according to the value I select in the TipoComboBoxColumn.
How do I go about accomplishing that? The code below works in part, BUT when I'm editing the value of SementeComboBoxColumn, the other values in this column disappear.
Code:private void tabBAdetDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (tabBAdetDataGridView.Columns[e.ColumnIndex].Name == "EspecieComboBoxColumn") { this.tabSementesTableAdapter.FillByTipo(this.sascrDataSet.tabSementes, tabBAdetDataGridView.Rows[e.RowIndex].Cells["TipoComboBoxColumn"].Value.ToString()); this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource; this.EspecieComboBoxColumn.DisplayMember = "Semente"; } else { this.tabSementesTableAdapter.Fill(this.sascrDataSet.tabSementes); this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource; this.EspecieComboBoxColumn.DisplayMember = "Semente"; } }
Thanks in advance,
JC Carmo



LinkBack URL
About LinkBacks


