Filter Data
Pre-Select an Item in Field Filter Dropdown

Code Customization
Pre-Select an Item in Field Filter Dropdown
Description:

Iron Speed Designer automatically creates dropdown lists on Show Table pages known as "Field Filters". A Field Filter control filters a table of records based on the value selected in the dropdown. This customization pre-selects an item in a field filter dropdown list control and filters the records with the matching values.

Normally, a Show Table page displays all records in a database table or view when the default value in the Field Filter is set to "All". Sometimes, you might want to display records specific to some value in a Field Filter when the page is initially displayed. The example shows how to set the default value of a FieldFilter on a Show Table page and filter the table records.

You can set the default value of a filter when a page loads the first time and filter the data based on the default value. To accomplish this, the example overrides the CreateWhereClause() method in the TableControl class and sets the item selected in the FieldFilter. Then, overrides the PopulateTableFilter() method in the TableControl class to filter the page

This customization will be added in:

..\<Application Name>\App_Code\<Table Name>\Show<Table Name>Table.Controls.cs

For example: C:\MyApp1\App_Code\Customers\ShowCustomersTable.Controls.cs

Procedure:

Step 1:  Use this wizard to add code customization.

Step 2:  Build and run the application.

Disclaimer:
Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. The Iron Speed Designer support team cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.


  Privacy Statement