ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • ListView control
  • Display error
  • Limitations
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Warning
From version 26, FileLink is kept for backward compatibility. This property has been replaced with DataBinding.
The DataBinding property gets and changes the binding between a control and:
  • a data file item.
  • a variable.
  • several variables (in this case, each variable can be bound to a different property of the control).
Reminder: The binding between a control and an item or variable is usually defined in the window or page editor, in the control description ("Binding" tab). This binding allows you to specify the data file item that will be used by the synchronization functions (ScreenToFile, ScreenToSource, PageToFile, PageToSource, FileToScreen, FileToPage, SourceToScreen, SourceToPage).
A control can be bound to an item from a base data file, or to an item from a linked data file. This is referred to as complex binding. Example of complex binding:
'Binding' tab of the control description
This property is equivalent to the ControlAlias function.
Example
// Binds the EDT_Edit1 control to the Name item of the Customer data file
EDT_Edit1.DataBinding = "Customer.Name"
// Same but from the Order data file with 1 binding
EDT_Edit2.DataBinding = "Order.CustomerID" + TAB + "Customer.CustomerID:Name"
// Same but from the OrdLine data file with 2 bindings
EDT_Edit3.DataBinding = "OrdLine.OrdID" + TAB + ...
		"Order.OrdID:CustomerID" + TAB + "Customer.CustomerID:Name"
// Binds TABLE_Table1 to Array_Month
TABLE_Table1.DataBinding = ":Array_Month"
// Update on the screen
FileToScreen()
// Whenever SourceToScreen is called, the EDT_Current_Allowed control will have: 
// - its displayed value updated by the Authorizing property of a class instance,
// - a background color assigned by the value of a global variable
gclContact is cContact
gsColor is int = PastelBlue
EDT_Current_Allowed.DataBinding = ":gclContact.Authorizing" + TAB + ...
	"value" + CR + ":gsColor" + TAB + "BackgroundColor"
// Update on the screen
SourceToScreen()
Syntax

Getting the binding between a control and an item or variable Hide the details

<Current binding> = <Control used>.DataBinding
<Current binding>: Character string
There are different types of bindings:
  • No binding: empty string ("")
  • Simple binding to a data file item:
    "<Base data file>.<Base item>"
  • Complex binding to a data file item:
    "<Base data file>.<Base item>[ + TAB + <Binding> [+ TAB + <Binding>]]"

    where <Binding> corresponds to:
    <Bound data file>.<Key>:<Bound item>[<Index>]
  • Binding to a variable:
    ":<prefix><Variable name>"
    or
    ":<Variable name>"
    (the prefix is applied only if the code style is enabled in the project).
<Control used>: Control name
Name of the control with the binding to be identified.

Changing the binding between a control and an item or variable Hide the details

<Control used>.DataBinding = <New binding>
<Control used>: Control name
Name of the control for which you want to change the data binding.
<New binding>: Character string
There are different types of bindings:
  • No binding: empty string ("")
  • Simple binding to a data file item:
    "<Base data file>.<Base item>"
  • Complex binding to a data file item:
    "<Base data file>.<Base item>[ + TAB + <Binding> [+ TAB + <Binding>]]"

    where <Binding> corresponds to:
    <Bound data file>.<Key>:<Bound item>[<Index>]
    Note: You can also use the following syntax:
    <[Base data file>.<Item>[<[Index]>] [: <Binding> [: <Binding>] ]

    where <Binding> = <Bound data file>.<Key>:<Displayed item> [<[Index]>]
  • Binding to a variable:
    ":<prefix><Variable name>"
    or
    ":<Variable name>"
    The prefix must be specified only if the code style is enabled in the project (whether or not prefixes are displayed).
  • Binding to a variable of type data source:
    <Variable name>.Name + ".<Base item>"
  • Binding multiple properties to multiple variables. The string that describes the binding must have the following format:
    ":" + <Variable name 1> + TAB + <Name of property 1> + CR + ...
    ":" + <Variable name 2> + TAB + <Name of property 2> + CR + ...
    ":" + <Name of variable N> + TAB + <Name of property N>
Remarks
WINDEVJava

ListView control

The DataBinding property allows you to get and modify the binding between the captions in a ListView control and a data file item.
WINDEVJava

Display error

You can use ControlError to customize the error message displayed in the controls when the control value cannot be displayed.

Limitations

The DataBinding property applies only to controls in a window or page.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/06/2025

Send a report | Local help