Fields are peers of your data’s "attributes" in DataPresenterBase-derived controls, in the same way that Records are peers of your data items.

Your data’s attributes will depend upon your data source’s schema. You can use any enumerable collection of .NET objects as your data source. This gives you considerable latitude to choose your data from .NET business objects, ADO.NET DataTables, and XML nodes selected with an XPath expression. Consequently, your data’s attributes can identify with the public properties of your .NET business object, the DataColumns of your DataTable, or the LocalName of your XML nodes.

Fields describe general qualities about their piece of data in every record that include:

  • A locally-unique Name that distinguishes it from other Fields of the same record.

  • An underlying DataType that describes the .NET Type of data values the cells of its records contain.

diagrams showing how data maps to fields

Following the data binding stage, the control discovers from your data source the attributes your data has, so that it can auto-generate Field objects from them. You can disable this behavior by setting the AutoGenerateFields property to False, which allows you to fully specify all Field objects yourself resulting in greater flexibility in their layout. You will find much more information on the layout of fields in the Field Layout topic.

diagram showing how fields are layed out

Fields can be used to specify more complex layouts than simple row- or column-based tables.

  • A Column and Row that determine its position in the Grid that lays out its Field Label.

  • A ColumnSpan and RowSpan that determine the vertical and horizontal extent of the Field Label positioned in the grid.

Fields can be hidden by setting their Visibility property to False. For example, if you had a Field that contained data intended for machine-use (for example, a GUID that acts as the primary key of your Record) rather than human-readability, then you might want to hide it from the view of your users.