how can i fill the gridlookupedit correctly?.
I can not find the error.
Method fill gridlookupedit
public void CargaGLEVerdadero()
{
pcbjEntidades contexto = new pcbjEntidades();
IList consultaModeloInsumosVerdadera = (from ModeloInsumoes in contexto.ModeloInsumoes
where
ModeloInsumoes.Activo == true
select new
{
ModeloInsumoes.NombreModeloInsumo
}).ToList();
gleNombreModelo.Properties.DataSource = new BindingSource(consultaModeloInsumosVerdadera, "");
}
Construct of form
public frmAgregarMarca()
{
InitializeComponent();
CargaGLEVerdadero();
}
This issue does not related to GridLookup directly rather the to the EF/Winforms interoperation.
Since you are using DevExpress, you can use the Data Source Configuration Wizard.This feature is available for any data-aware control in threir suite and it knows how to do the things correctly and it can make all the work for you:
Then you can customize Wizard's output: