Tuesday 9 February 2010

Asp.Net Dynamic Data – DisplayColumn Part 2

In my previous post I outlined how to use the DisplayColumn attribute to specify the column you want to use to display to represent the foreign key.
The attribute is smarter than that though in that it supports multiple arguments.
The signature for the attribute is:
DisplayColumn[“Column to display”, “Column to sort by”, Sort order]


This means you pick the column you want to show, the column to use when sorting and the sort order.


Most times you set the display and sort columns to the same value but the flexibility is there to pick another column if you need to.

No comments:

Post a Comment