Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by PlausiblyDamp
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...