C# 2005 - ComboBoxes with Parent / Child relation in DataGridView

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2006
Posts: 8
Reputation: jcrcarmo is an unknown quantity at this point 
Solved Threads: 0
jcrcarmo jcrcarmo is offline Offline
Newbie Poster

C# 2005 - ComboBoxes with Parent / Child relation in DataGridView

 
0
  #1
Feb 22nd, 2006
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.


  1. private void tabBAdetDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
  2. {
  3. if (tabBAdetDataGridView.Columns[e.ColumnIndex].Name == "EspecieComboBoxColumn")
  4. {
  5. this.tabSementesTableAdapter.FillByTipo(this.sascrDataSet.tabSementes, tabBAdetDataGridView.Rows[e.RowIndex].Cells["TipoComboBoxColumn"].Value.ToString());
  6. this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource;
  7. this.EspecieComboBoxColumn.DisplayMember = "Semente";
  8. }
  9. else
  10. {
  11. this.tabSementesTableAdapter.Fill(this.sascrDataSet.tabSementes);
  12. this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource;
  13. this.EspecieComboBoxColumn.DisplayMember = "Semente";
  14. }
  15. }


Thanks in advance,

JC Carmo
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC