As clear from the title, my datagridviewComboboxCell, which I am adding to selected cells only, are showing it's dropdown list perfectly, and I can select them seamlessly. Problem arises when the combobox losses focus, it forgets everything about selected item and auto selects the item at index 0, of it's range collection. And many time, a 'DataGridViewDataErrorEvent' is occuring(I traced it by adding DataError event handler). I can not understand what is going wrong to cause the error to fire. Moreover even though I daclare e.Cancel = false; in the eventhandler, the ComboBox auto-selects item at index 0. Plese help me out of this. N.B . I forgot to add initially(when it appears to screen!), the DataGridViewComboBox has no item selected. EDIT:- Code snippet
//Creating and Adding propertiesof DataGridViewComboBoxCell.
RegViewdataGridView.Rows[uniqcustCount].Cells[day].ReadOnly = false; //uniqcustCount & day Are Integers
var pcmbcell = new DataGridViewComboBoxCell();
var tcmbcell = new DataGridViewComboBoxCell();
RegViewdataGridView[day,uniqcustCount] = pcmbcell;
pcmbcell.ReadOnly = false;
pcmbcell.DropDownWidth = 80;
pcmbcell.DataSource = shipdPrdLst;
pcmbcell.DisplayStyle = DataGridViewComboBoxDisplayStyle.ComboBox;
RegViewdataGridView.DataError += RegViewdataGridView_DataError;
void RegViewdataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
e.Cancel = false;
}