Friday 25 September 2009

Asp.Net Dynamic Data – Attributes

I’ve been doing some more dynamic data and trying to work with the meta data for a table to change the display.

Previously I’ve mentioned ordering columns and although not explicitly mentioned it the hiding of columns you don’t won’t by applying the [ScaffoldColumn(true)] attribute where you set true so DD generates a column and false if you don’t want it displayed.

The attributes that I can find in relation to display of the data are:

Attribute Name Description
Scaffold Column Indicates if column should be displayed or not
DisplayName Name to be displayed in the header of the column for the property
DefaultValue Default value to use when inserting new data
Description Text to show in a tooltip when mouse hovers over the field
DataType Used to specifies the name of a type to associate with a data field to provide additional functional around that field e.g EmailAddress
UIHint Used to specify the FieldTemplate to use when rendering the column.
DisplayColumn Specifies the column to display for filters or foreign keys.  Default is to use first string column that is found

Over the next few posts I’ll being going into these attributes to show the source code and the results.

Original post

No comments:

Post a Comment