PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • ListView control
  • Display error
  • Limitations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 26, FileLink is kept for backward compatibility. This property is replaced by DataBinding.
The DataBinding property is used to identify and change the binding between a control and:
  • and an item in a data file.
  • and a variable.
  • and 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).
Example of multi-file 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

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

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

    where <Binding> corresponds to:
    <Related 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.

Modifying 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 with the binding to be modified.
<New binding>: Character string
Different types of bindings can be defined:
  • No binding: empty string ("")
  • Simple binding to an item of a data file:
    "<Base file>.<Base item>"
  • Complex binding to an item of a data file:
    "<Base file>.<Base item>[ + TAB + <Binding> [+ TAB + <Binding>]]"

    where <Binding> corresponds to:
    <Related file>.<Key>:<Bound item>[<Index>]
    Remark: the following syntax is also accepted:
    <[Base file>.<Item>[<[Index]>] [: <Binding> [: <Binding>] ]

    where <Binding> = <Bound file>.<Key>:<DispItem> [<[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 (no matter whether prefixes are displayed or not).
  • Binding to a variable of type data source:
    <Variable name>.Name + ".<Base item>"
  • Bind multiple properties to multiple variables: the character string that describes the binding must have the following format:
    ":" + <Name of variable 1> + TAB + <Name of property 1> + CR + ...
    ":" + <Name of variable 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 an item in a data file.
WINDEVJava

Display error

ControlError is used 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.
Android Widget This property only applies to the following controls:
  • Button control.
  • Static control.
  • Image control.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment