943,947 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 7620
  • C# RSS
Feb 22nd, 2006
0

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

Expand Post »
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.


C# Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jcrcarmo is offline Offline
8 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Closed event of a form
Next Thread in C# Forum Timeline: Develop a software to remove duplication





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC