Thursday, 11 February 2010

Asp.Net Dynamic Data – UI Hint Part 2

Like the DisplayColumn attribute the UIHint supports multiple arguments allowing you to pass additional data to the field template.

The signature for the attribute is:

UIHInt[field template to use,Presentation Layer, Control parameters]

The arguments are:

Field template – covered in the last post

Presentation Layer – From what I can discover this is not currently used but the suggested values from intellisense of HTML, Silverlight, WPF or Winforms indicate the maybe its roll will change in the future.

Control Parameters – a param object array allowing you to pass as many additional parameters to the field template as you want but you need to pass key value pairs e.g. “argument1”,10

If you build your own custom field template then the control parameters may provide you a mechanism to provide additional data you need.  The only problem is that if you are using the attribute on a class the values will be hardcoded, which doesn’t allow for much flexibility.

No comments:

Post a Comment