private void OnQueryPopup(object sender, CancelEventArgs e) { var pl = new PalletLocation(); var lke = (LookUpEdit)gridDetailView.ActiveEditor; int itemID = Convert.ToInt32(gridDetailView.GetFocusedDataRow()["ItemID"]); lke.Properties.DataSource = PalletLocation.GetAllFreeFor(itemID); }
private void grdViewSTVDetails_ShownEditor(object sender, EventArgs e) { var view = (GridView)sender; if (view.FocusedColumn.FieldName != "PalletLocationID") { return; } var lke = (GridLookUpEdit)view.ActiveEditor; var selectedRow = view.GetFocusedDataRow(); var itemID = Convert.ToInt32(selectedRow["ItemID"]); var warehouseID = Convert.ToInt32(lkWarehouse.EditValue); lke.Properties.DataSource = PalletLocation.GetAllFreeFor(itemID, 0, CurrentContext.UserId).AsEnumerable().Where( l => Convert.ToInt32(l["WarehouseID"]) == warehouseID).CopyToDataTable(); }