Operation is not valid because it results in a reentrant call to the SetCurrentCellAd

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ANILMOURYA
    New Member
    • Sep 2008
    • 1

    Operation is not valid because it results in a reentrant call to the SetCurrentCellAd

    Code:
    private void FlexGrdRsltConv_CellEnter(object sender, DataGridViewCellEventArgs e)
    
                 {
                 
                     if (blnRowenter) { return;}
    
                     if (FlexGrdRsltConv.Columns[e.ColumnIndex].Name == "TxtEltCode")
                     {
                          
                         DataGridViewComboBoxCell RowComboColumn = new DataGridViewComboBoxCell();
                         RowComboColumn.DisplayMember = "elmnt_cd";
                         RowComboColumn.ValueMember = "elmnt_id";
                         RowComboColumn.DataSource = DSVstPrdct.Tables[0];
                         
    
                     
                             FlexGrdRsltConv.Rows[e.RowIndex].Cells[e.ColumnIndex]   = RowComboColumn;
                             }
    }
    I am adding the combobox to datagridview.

    on change of row the combox is added on new row and at the old row the combox is removed.

    on addition of three new row the combox get added but as the fourth row is added it gives the error

    "Operation is not valid because it results in a reentrant call to the SetCurrentCellA ddressCore function."

    where the e.RowIndex and e.ColumnIndex is same as = 3.

    pls find the solution as soon as possible.
    Last edited by kenobewan; Sep 16 '08, 01:27 PM. Reason: Use # tags
Working...