public void addContextMenu(DataRow row) { orderGrid.ifVisible(row, () => { var menu = new QContextMenu(); if (FerretControl.canRelease()) { menu.add("Release", () => orderTracker.releaseMaybe(orderGrid.selectedRows())); } menu.add("Cancel", () => orderTracker.cancelMaybe(orderGrid.selectedRows())); orderGrid.resetContextMenu(row, menu); }); }