private void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e) { var monedasUsadas = AGlobalDataContext.CuentasBancariasDeCliente.Where(c => c.ControlClienteId == AGlobalControlClientes.ControlClienteID).Select(d => d.TipoMonedaId); int[] monedasIds = new int[DynamicQueryable.Count(monedasUsadas)]; int i = 0; foreach (var monedaUsada in monedasUsadas) { monedasIds[i] = monedaUsada; i++; } TipoMoneda_repositoryItemLookUpEdit.DataSource = AGlobalDataContext.TipoMoneda.Where(c => !monedasIds.Contains(c.TipoMonedaID)); TipoMoneda_repositoryItemLookUpEdit.ForceInitialize(); gridView1.SetRowCellValue(e.RowHandle, colControlClienteId, AGlobalControlClientes.ControlClienteID); }
public int Count(IQueryable source) { return(DynamicQueryable.Count(source)); }