"main seating for spectators at an outdoor event," 1834, from grand (adj.)+ stand. The verb meaning "to show off" is student slang from 1895, from grandstand player, attested in baseball slang from 1888.
Cf. British gallery hit (1882) "showy play by a batsman in cricket, 'intended to gain applause from uncritical spectators'" [OED]. Related: grandstanding.