You should use FilterUIHintAttribute
class that allows to replace (or add new filters) default filters on the CopyTermsHolidays
entity.
For example:
[Required]
[UIHint("AcademicYear")]
[FilterUIHint("AcademicYearFilter")]
public int AcademicYear { get; set; }
where AcademicYearFilter
is custom filter which need to be located in ~\DynamicData\Filters
directory (AcademicYearFilter.ascx
).
More information at FilterUIHintAttribute Class.
I will take courage to attach to my answer filter template lookup algorithm and some
citation from ASP.NET Dynamic Data UNLEASHED:
Compared to the lookup rules for field templates, lookup rules for
filter templates are simple. Dynamic Data uses only the FilterUIHint
associated with the column and has an intrinsic knowledge of several
column types. If the FilterUIHint is not specified in the data model,
and the column is Foreign Key (a column that represents the parent
navigation property of a many-to-one or a one-to-one association in
the child entity), a Boolean, or an enumeration, Dynamic Data chooses
a predefined FilterUIHint value, ForeignKey, Boolean, or Enumeration,
respectively. Having the FilterUIHint value, Dynamic Data tries to
locate a user control with the matching name in the
DynamicData\Filters directory of the web application project. If the
user control does not exist, the lookup process ends, and filtering is
considered to be unsupported for this column.
