Gridlookupedit实体框架

时间:2016-03-24 14:34:41

标签: c# entity-framework linq devexpress gridlookupedit

如何正确填写gridlookupedit? 我找不到错误。

方法填充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, "");
    }

表单构造

public frmAgregarMarca()
    {
        InitializeComponent();
        CargaGLEVerdadero();
    }

Result

1 个答案:

答案 0 :(得分:0)

此问题与GridLookup无直接关系,而与EF / Winforms互操作无关。

由于您使用的是DevExpress,因此可以使用Data Source Configuration Wizard。此功能适用于threir套件中的任何数据感知控件,并且它知道如何正确执行操作并且可以为您完成所有工作:

component('demo', {
  template: `<div>
            <div ng-if="verificationFailed">Sorry, failed to verify</div>
            <button ng-if="continueEnabled">Continue</button>
            <button ng-click="verify()">Verify</button>
            </div>`,
  controllerAs: 'ctrl',
  bindings: {
    someOptions: '='
  },
  controller: ($scope, someService) => {
    var ctrl = this;

    ctrl.continueEnabled = false;

    ctrl.verificationFailed = false;

    ctrl.verify = function() {
      Rx
      .Observable
      .interval(10 * 1000)
      .timeout(2 * 60 * 1000)
      .flatMapLatest(_ => { someService.verify(ctrl.someOptions.id)})
      .retry(1)
      .filter((result) => { result.completed })
      .take(1)
      .subscribe(_ => {
        $scope.$evalAsync(_ => {
          ctrl.continueEnabled = true
        });
      }, _ => {
        $scope.$evalAsync(() => {
          ctrl.verificationFailed = true;
        });
      });
    };
  }
});

然后您可以自定义向导的输出:

{{1}}