How to use Type with Repeater control

Prerequisite: Complete tutorial How to use the Repeater control

With some simple modifications to the existing solution, we are now going to explore the use of Types with Repeaters

  1. Create a Type named employee with 3 fields,
    FirstName, LastName and Photo

  2. In the repeater properties, select the Listitem Type of the repeater as employee

  3. Now you will be able to see the ListItem in SetValue (within Repeater.ItemLoad) for the different controls inside the repeater.


Why do you need to use Types?

Using Types with the repeater control gives you access to the properties of the type from within the Property Grid. Using Types will not only save you from typing the property name manually but maintenance will be easier also!