jcrcarmo Posted February 18, 2006 Posted February 18, 2006 (edited) Hello everyone, 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 for the other rows in this column disappear. This is driving nuts! 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 Edited February 22, 2006 by PlausiblyDamp Quote
Voldron Posted February 28, 2006 Posted February 28, 2006 Try using a dataset and fetching a row from it, when a row is selected then bind each value to its appropriate combo box. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.