The requested page is not available for the requested platform. You are viewing the content for Default platform.

How to: Present Data in Cards

This example shows how to use data row templates (GridViewTemplates.DataRow) to create a custom cell layout within data rows.

The image below shows the result:


                 <div style="padding:5px">
                     <table class="templateTable" cellpadding="2" cellspacing="1" >
                             <td rowspan="4"><img src="CardView.aspx?Photo=
                             <%# Eval("EmployeeID")%>"/></td>
                             <td class="templateCaption">First Name</td>
                             <td><%# Eval("FirstName") %></td>
                             <td class="templateCaption">Last Name</td>
                             <td><%# Eval("LastName")%></td>

                             <td class="templateCaption">Title</td>
                             <td colspan="3"><%# Eval("Title")%></td>
                             <td class="templateCaption">Birth Date</td>
                             <td ><%# Eval("BirthDate")%></td>
                             <td class="templateCaption">Hire Date</td>
                             <td><%# Eval("HireDate")%></td>
                         <td colspan="4" style="white-space:normal"><%# Eval("Notes") %> </td>