I am trying to implement a ListView data control for displaying and editing lookup table/ application level variables. There are multiple entity classes which can be bound to the ListView, so the ItemTemplate needs to be dynamically bound to the selected entity object.
For example i have:
AddressType { AddressTypeId, AddressTypeDescription}, PhoneType { PhoneTypeId, PhoneType}, MarriageStatusType { MarriageStatusId, marriageStatusType}
Those generated entity objects prevent me from simply doing something like the following snippet, because the ID and Type properties are different on each business object.
<ListView> ... <itemTemplate> <tr> <td runat='server' id='tdId'> <%# Eval('ID') %> </td> <td runat='server' id='tdType'> <%# Eval('TypeNameDescription') %> </td> </tr> </itemTemplate> ... </ListView>
I am trying to discover : 1. How to iterate over the ListView Items to insert the appropriate property value into the server side html td tags. 2. How to use Databinder.Eval on the ListView items to insert that property value.
Thanks in advance!
Ok in answer to your questions:
Hope it helps..