I have a method that updates a column that contains a type DataGridViewComboBoxCell, early ComboBoxCell is empty, select a product and ComboBoxCell is updated when adding a new record is done well, but when I modify it sends an exception : "DataGridViewComboBoxCell value is not valid" Not if you are when you reassign the DataSource property.
Here the method:
private void CargarTipoGasto(ref DataGridViewComboBoxCell ComboColumn)
{
ComboColumn.DataSource = from oPro in dtContext.tblProducto
where oPro.ProductoId == objProducto.ProductoId
from oMat in dtContext.tblMatrizDeCuentasGD
where oMat.Partida.Substring(0,3) ==
oPro.tblObjetoGasto.ObjetoGastoId.Substring(0,3)
from oTipGas in dtContext.tblTipoGasto
where oMat.TipoGasto == oTipGas.TipoGastoId
select oTipGas;
ComboColumn.ValueMember = TIPOGASTO_ID;
ComboColumn.DisplayMember = TIPOGASTO_VALOR;
}
verique that no null values, that the references are well
thank you very much for any help