fix row selection when using row templates