Modifies a database query by using a value from specified filter control.
Public Class DynamicFilterExpression _ Inherits DataSourceExpression
public class DynamicFilterExpression : DataSourceExpression
public ref class DynamicFilterExpression : public DataSourceExpression
type DynamicFilterExpression = class inherit DataSourceExpression end
The DynamicFilterExpression type exposes the following members.
The DynamicFilterExpression class enables you to modify a database query using the values that are assigned in a DynamicFilter control. This control delegates the task of building of the IQueryable query to a specialized control such as QueryableFilterRepeater control or DynamicFilter control.
The filter controls in turn delegate the building of the query to the filter template that they reference. The query is then executed by the data source control that is referenced by the QueryExtender control.
To use the DynamicFilterExpression class in a page, you follow these steps:
Add a QueryExtender control to the page.
Set the TargetControlID property of the QueryExtender control to reference the data source control.
Add a DynamicFilterExpression object as a child of the QueryExtender control.
Set the ControlID property of the DynamicFilterExpression object to reference the filter control.
In the previous steps it is assumed that the related filter controls, data-bound controls, and data source control are defined in the page.
The following example shows how to use the DynamicFilterExpression control to select a filter template in a page. The filter template is selected by the DynamicFilter control that is identified by DynamicFilterExpression control through its ControID property.
<asp:QueryExtender ID="QueryExtender1" TargetControlID="GridDataSource" runat="server"> <asp:DynamicFilterExpression ControlID="CategoryFilterID" /> </asp:QueryExtender>
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2