Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Newbie
 
Join Date: Sep 2008
Posts: 1
#1: Sep 15 '08
Expand|Select|Wrap|Line Numbers
  1. private void FlexGrdRsltConv_CellEnter(object sender, DataGridViewCellEventArgs e)
  2.  
  3.              {
  4.  
  5.                  if (blnRowenter) { return;}
  6.  
  7.                  if (FlexGrdRsltConv.Columns[e.ColumnIndex].Name == "TxtEltCode")
  8.                  {
  9.  
  10.                      DataGridViewComboBoxCell RowComboColumn = new DataGridViewComboBoxCell();
  11.                      RowComboColumn.DisplayMember = "elmnt_cd";
  12.                      RowComboColumn.ValueMember = "elmnt_id";
  13.                      RowComboColumn.DataSource = DSVstPrdct.Tables[0];
  14.  
  15.  
  16.  
  17.                          FlexGrdRsltConv.Rows[e.RowIndex].Cells[e.ColumnIndex]   = RowComboColumn;
  18.                          }
  19. }
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 SetCurrentCellAddressCore function."

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

pls find the solution as soon as possible.

Reply