Create two fields that enable you to filter motors based on their manufacture date and time.
-
Create the From field:
-
Right-click MainWindow (type) and select .
-
Hover-over the object, select
, and enter FilterFromDateTime.
-
In Properties, set Value to the oldest Motor manufacture date.
Tip: Motor manufacture dates are set while creating the Motor object type and object instances.
-
Create the To field:
-
Right-click MainWindow (type) and select .
-
Hover-over the object, select
, and enter FilterToDateTime.
-
In Properties, set the Value property to the newest Motor manufacture date.
Tip: Motor manufacture dates are set while creating the Motor object type and object instances.
-
Create labels:
-
Create three labels by right-clicking MainWindow (type) and selecting .
-
Rename the labels by hovering-over each label, selecting
, and entering:
-
FilterDateTimeLabel
-
FilterFromDateTimeLabel
-
FilterToDateTimeLabel
-
Select FilterDateTimeLabel and in Properties, set Text to Filter motors by manufacture date.
-
Select FilterFromDateTimeLabel and in Properties, set Text to From:.
-
Select FilterToDateTimeLabel and in Properties, set Text to To:.
-
Make the data grid filterable:
-
Select MotorDateTimeGrid.
-
In Properties, create an advanced dynamic link between the Query property and To and From objects values by using a string formatter.
- Format
-
SELECT * FROM Model WHERE ManufactureDate BETWEEN {0:sql_literal} and {1:sql_literal}
- {0} DynamicLink
- .
- {1} DynamicLink
For more information about dynamic links, see Create dynamic links.