using Template Column to customize the layout of column - DataForm.NET Sample

This example shows how to customize a Template Column (Employee Column in the GridForm) in GridForm. A template column allows you to create a custom layout for a column based on any mixture of HTML, static text and data from database.The demo below shows the first column which contains a image and an employeeid

Pick a Theme:

Employees 
 Employee
Employee Name
CityHire DateTitlePhoto
  

Employee ID:1
Davolio, NancySeattle5/1/1992Sales Representative

Employee ID:2
Fuller, KayTacoma8/14/1992Vice President, Sales

Employee ID:3
Leverling, JanetKirkland4/29/1992Sales Representative
1 - 3 / 22 RecordsPage / 8 
Birth Date12/8/1948
Address507 - 20th Ave. E.Apt. 2A
RegionWA
Postal Code98122
CountryUSA
Home Phone(206) 555-9857
Birth Date2/19/1952
Address908 W. Capital Way
RegionWA
Postal Code98401
CountryUSA
Home Phone(206) 555-9482
Birth Date8/30/1963
Address722 Moss Bay Blvd.
RegionWA
Postal Code98033
CountryUSA
Home Phone(206) 555-3412

  Design   Source  
  1. Open DataForm.NET Manager. In DataForm.NET List page, choose Employees by clicking the link.
  2. In the DataForm.NET Designer on the right hand side, switch to GridForm tab.
  3. Click Employee to open up the GridForm Fields Designer window.
  4. The column type is set to Template Column.
  5. The content of Template Column is defined in the underneath RichContentBox. In this example, Employee column displays an employee picture and employeeID as well as static html.
  6. To reference a field from datasource, use {field!fieldname} syntax, for instance, {field!employeeid}. To display an image or file, use {file!fieldname} syntax, for instance, {file!photo}.
    Combine data with any HTML and static text to customize the column layout.
  • Click HERE to open up a READ ONLY DataForm.NET Manager.
  • Click HERE to try for yourself.