- Default events
- Optional events
- Filtering records (browsing TreeView Table control only)
- Before displaying the automatic tooltip of scrollbar
Events associated with TreeView Table controls
and WINDEV Mobile
manage the following events by default (order of appearance in the code editor):
|Initialization||Run when the window is opened. *|
Special case: Browsing TreeView Table control automatically filled
When this code is run, the TreeView Table control is not populated yet. To force the control to be filled in this code, use:You can also filter records with HFilter.
|End of initialization||Code only for browsing TreeView Table controls populated automatically|
Run once the control has been filled. This code is used to select an element in the TreeView Table control, to add or modify an element.
|Entry in the TreeView Table control||Run when the control takes focus.|
|Exit from the TreeView Table control||Run when moving from one control to another (TAB key, selecting another control with the mouse, etc.).|
|Entry in input in a row of the TreeView Table control||Run when the user selects a row to perform an input in this row.|
|Exit from a row of the TreeView Table control||Run when moving from one row or control to another (TAB key, selecting another control with the mouse, etc.).|
|Displaying a row of the TreeView Table control||Run when a new row must be displayed in the TreeView Table control, for example when one of the following actions is performed: re-display the control, scroll or move in the control, ...|
|Selecting a row of the TreeView Table control||Run when the user selects a row (without input). |
TreeView Table controls include the following option: "Expand by clicking the row". If this option is checked, the hierarchy can be expanded by clicking on the row (and not only on the expand icon).
|Collapsing/Expanding a node of the TreeView Table control||Run when the user expands or collapses a node. |
Remark: To get the name of the collapsed/expanded row in this event, use the following syntax: TreeViewTableName[TreeViewTableName].
(*) By default, the "Initializing" event of each control is run according to the order in which the controls were created in the window. To modify this order of execution:
- On the "Window" tab, in the "Order" group, click "Initialization".
- In the window displayed, use the arrows on the right to modify the order in which the controls are initialized.
Several optional events are supported.
To add an optional event:
- Select the desired control.
- Display the code window of this control (F2 key).
- Click the link "Add other events to xxx" at the bottom of the window code, after the last event.
- All the optional events available for the control are displayed.
- Check the optional event to add and validate.
Remark: You can select several optional events.
- The selected optional event is automatically added to the events managed by the control.
To disable an optional event, simply perform the same operations to display the list of optional events. Then simply uncheck the optional events to delete.
Remark: If the disabled code contains WLanguage code, this code is automatically deleted.
You can manage, for example:
- the mouse hover over the control,
- left mouse button down, up, with a double click,
- right mouse button down, up, double click,
- mouse wheel, etc.
Remark: The optional events differ according to the environment (WINDEV, WEBDEV, WINDEV Mobile) and the development platform.
Filtering records (browsing TreeView Table control only)
The event "Filtering the records" is run right after a row of the TreeView Table control is displayed. Therefore, it is run:
- when initializing the control.
- whenever a row is displayed in the TreeView Table control.
This event is used to filter the records displayed in the TreeView Table control.
To implement a filter, the "Filter records" event must return a value:
- True to specify that the record matches to the filter and that it must be displayed.
- False to specify that the record does not match the filter and that it must not be displayed.
- Cancel to stop reading the data source of the TreeView Table control (very rare case).
// -- Filtrage des enregistrements --
// Affiche uniquement les clients dont commandes sont supérieures à 3000 euros
IF Commande.TotalTTC >= 3000 THEN
In this code, the data handled affects the record currently read by the TreeView Table control. This data comes from the date file or from the query linked to the control.
If an automatic filter is applied on the TreeView Table control (TableEnableFilter
or filter enabled directly by the user), the filter defined by the event "Filtering records" is added to the automatic filter.
Before displaying the automatic tooltip of scrollbar
The tooltip for the scrollbar of TreeView Table controls is displayed when the user clicks the "box" of the vertical scrollbar in the TreeView Table.
This tooltip contains the following information by default:
- Range of rows currently displayed in the TreeView Table control.
- Total number of rows in the TreeView Table control.
- Information about the element currently displayed in the first row of the control in the sorted column.
The optional event "Before displaying the automatic tooltip of the scrollbar" is run just before the tooltip is displayed. This allows displaying a specific text in the tooltip of the TreeView Table control using the ToolTip
property, for example.
This page is also available for…