Electioneering ends for by-election in 21 constituencies