Databases Reference
In-Depth Information
FIGURE 12.2
Unleashed filter classes.
UnleashedFilter
The
UnleashedFilter
control is a replacement for the built-in
DynamicFilter
control. It
provides properties (
DataField
,
FilterUIHint
, and
FilterTemplate)
events (
FilterChanged
)
and methods (
OnFilterChanged)
that mimic corresponding members of the
DynamicFilter
control and should be 100% compatible and familiar to you from a discussion in Chapter 5.
The
DataSource
property is new. It allows you to get or set the
IQueryableDataSource
instance with which the filter is associated. In the
DynamicFilter
, the data source object is
stored in a private field; however, in the
UnleashedFilter
, you need to be able to set it
not only from a data source expression, but also from a filter template that has a nested
filter control.
The
Table
and
Column
properties of the
UnleashedFilter
are provided for consistency and
mimic similar properties of the built-in
DynamicControl
. You can set the
Table
property
explicitly, but the control can also determine it automatically by retrieving the
MetaTable
object associated with its
DataSource
control. Likewise, the
Column
property can be set
directly; however, the control automatically finds the
MetaColumn
object in the associated
MetaTable
using the name specified in the
DataField
property.
Like the
DynamicControl
, the
UnleashedFilter
supports specifying custom attributes in
page markup and automatically sets matching public properties of the filter template it
instantiates. And like the
UnleashedControl
, the
UnleashedFilter
automatically initializes
public properties of the filter template based on the control parameters specified for the
entity property with the
FilterUIHintAttribute
.