ASP.NET Dynamic Data enables you to use page markup to filter the table rows to display and provides the UI that enables the user to enter the values needed for custom row filtering. Dynamic Data will infer the filter template for creating the UI based on the column type. By default, Boolean and foreign-key columns are used for filtering.
Custom filtering requires the following steps:
This lets you perform data filtering by using simple page markup without requiring knowledge of the data source control and of the database query details.
Multiple System.Web.DynamicData.DynamicFilter controls can be used to allow for multiple filtering criteria.
The following figure shows the process that Dynamic Data elements follow in order to implement filtering.
These are the steps followed:
Dynamic Data Table Rows Filtering Elements
<asp:DynamicFilter ID="CategoryFilterID" DataField="ProductCategory" runat="server"/>
Dynamic Data will infer the filter template to use based on the column type. It will throw a System.InvalidOperationException if the column type does not have an associated default filter template.
<asp:QueryExtender ID="QueryExtenderID" TargetControlID="GridDataSource" runat="server"/></asp:QueryExtender>
<asp:QueryExtender ID="QueryExtenderID" TargetControlID="GridDataSource" runat="server"/>
<asp:DynamicFilterExpression ID="CategoryFilterID"/> </asp:QueryExtender>
<asp:DynamicFilterExpression ID="CategoryFilterID"/>
</asp:QueryExtender>
The following example uses the ForeignKey.ascx filter template to create a System.Web.UI.WebControls.DropDownList control for the Products foreign key column ProductCategory. When the user selects a value from this control, the example displays only those Products table rows that contain that value.
Refer to the attached files.
Note:
Compiling the Code
This example requires the following:
Obsolete. Please refer to Customize Table Rows Filtering in Dynamic Data . Thanks
electronic components http://www.partinchina.com
electronic world http://www.partsparty.com