ControlFilterExpression ControlFilterExpression ControlFilterExpression ControlFilterExpression Class

Definition

Modifies a database query by using the data key of the item that is selected in a data-bound control.

public ref class ControlFilterExpression : System::Web::UI::WebControls::Expressions::DataSourceExpression
public class ControlFilterExpression : System.Web.UI.WebControls.Expressions.DataSourceExpression
type ControlFilterExpression = class
    inherit DataSourceExpression
Public Class ControlFilterExpression
Inherits DataSourceExpression
Inheritance
ControlFilterExpressionControlFilterExpressionControlFilterExpressionControlFilterExpression

Examples

The following example shows how to use the ControlFilterExpression class to reference a source data-bound control, where the data key is selected. The QueryExtender control points to a target data source control that obtains data that is filtered by using the selected data key. In the example, the source data-bound control references a parent table and the target data-bound control references a child table.

<asp:QueryExtender ID="QueryExtenderID"   
    TargetControlID="TargetDataSourceID" runat="server">  
    <asp:ControlFilterExpression ControlID="SourceGridViewID" />  
</asp:QueryExtender>  

Remarks

The ControlFilterExpression class that is designed to be used when a page contains two data-bound controls such as a GridView control and a ListView control. One control is the source, where a data key (row) is selected. The other control is the target where the data is displayed based on the selected data key. The target data is obtained by a data source control that executes the query that is defined in the QueryExtender class and that is built by using the selected data key.

To use the ControlFilterExpression class in a page, you follow these steps:

Constructors

ControlFilterExpression() ControlFilterExpression() ControlFilterExpression() ControlFilterExpression()

Initializes a new instance of the ControlFilterExpression class.

Properties

Column Column Column Column

Gets or sets the name of the column that the query is based on.

Context Context Context Context

Gets the HttpContext instance of the owner control.

(Inherited from DataSourceExpression)
ControlID ControlID ControlID ControlID

Gets or sets the ID of the source data-bound control.

DataSource DataSource DataSource DataSource

Gets the data source object that is associated with the owner control.

(Inherited from DataSourceExpression)
IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState

When implemented by a class, gets a value that indicates whether a data source expression object is tracking its view state changes.

(Inherited from DataSourceExpression)
IsTrackingViewState IsTrackingViewState IsTrackingViewState IsTrackingViewState

Gets a value that indicates whether a data source expression object is tracking its view state changes.

(Inherited from DataSourceExpression)
Owner Owner Owner Owner

Gets the owner control.

(Inherited from DataSourceExpression)
ViewState ViewState ViewState ViewState

Gets an instance of the StateBag class that contains the current view state information.

(Inherited from DataSourceExpression)

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetQueryable(IQueryable) GetQueryable(IQueryable) GetQueryable(IQueryable) GetQueryable(IQueryable)

Gets the data source query to modify.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
LoadViewState(Object) LoadViewState(Object) LoadViewState(Object) LoadViewState(Object)

Restores the previously saved view state.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SaveViewState() SaveViewState() SaveViewState() SaveViewState()

Saves the changes to view state since the time the page was posted to the server.

SetContext(Control, HttpContext, IQueryableDataSource) SetContext(Control, HttpContext, IQueryableDataSource) SetContext(Control, HttpContext, IQueryableDataSource) SetContext(Control, HttpContext, IQueryableDataSource)

Initializes the filter expression with data source information.

SetDirty() SetDirty() SetDirty() SetDirty()

Marks the DataSourceExpression object so that its state will be saved in view state.

(Inherited from DataSourceExpression)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrackViewState() TrackViewState() TrackViewState() TrackViewState()

Causes the ControlFilterExpression object to track changes to its view state so they can be stored in the control's view state object and to be persisted across requests for the same page.

Explicit Interface Implementations

IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object)

When implemented by a class, loads the previously saved view state of the data source expression object.

(Inherited from DataSourceExpression)
IStateManager.SaveViewState() IStateManager.SaveViewState() IStateManager.SaveViewState() IStateManager.SaveViewState()

When implemented by a class, saves the current view state of the DataSourceExpression object.

(Inherited from DataSourceExpression)
IStateManager.TrackViewState() IStateManager.TrackViewState() IStateManager.TrackViewState() IStateManager.TrackViewState()

When implemented by a class, tracks view state changes of the DataSourceExpression object so that the changes can be stored in the StateBag object for the data source expression object.

(Inherited from DataSourceExpression)

Applies to

See also