Create an interface for filtering date and time data
Create two fields that enable you to filter motors based on their manufacture date and time.
- Create theFromfield:
- Right-clickMainWindow (type)and select .
- Hover-over the object, select , and enterFilterFromDateTime.
- InProperties, setValueto the oldest Motor manufacture date.TIP: Motor manufacture dates are set while creating the Motor object type and object instances.
- Create theTofield:
- Right-clickMainWindow (type)and select .
- Hover-over the object, select , and enterFilterToDateTime.
- InProperties, set theValueproperty 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-clickingMainWindow (type)and selecting .
- Rename the labels by hovering-over each label, selecting , and entering:
- FilterDateTimeLabel
- FilterFromDateTimeLabel
- FilterToDateTimeLabel
- SelectFilterDateTimeLabeland inProperties, setTexttoFilter motors by manufacture date.
- SelectFilterFromDateTimeLabeland inProperties, setTexttoFrom:.
- SelectFilterToDateTimeLabeland inProperties, setTexttoTo:.
- Make the data grid filterable:
- SelectMotorDateTimeGrid.
- InProperties, create an advanced dynamic link between theQueryproperty andToandFromobjects 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.
Provide Feedback