please, look at ListView. Maybe you can replace the using of TemplateView with ListView.