The commercial real estate company Grubb & Ellis agrees to sell nearly all of its assets to BGC Partners, a firm run by Howard W. Lutnick, who is also the chief executive of Cantor Fitzgerald.