PC SOFT

WINDEV的在线文档

  • Overview
  • Initializing a TreeView Table control
  • Adding or modifying rows in a TreeView Table control
  • Adding rows into a TreeView Table control'''
  • Modifying a row or a column
  • Resuming the input in a column
  • Adding or deleting a column
  • Managing the calculated columns
  • Operations on the rows and cells
  • Deleting a row
  • Selecting a row
  • Retrieving the content of a row or the content of a cell
  • Value of a cell in the current row
  • Value of a cell in a specific row
  • Content of the current row
  • Content of a specific row
  • Operations on the tree structure
  • Collapsing all the nodes of a TreeView Table control
  • Expanding all the nodes of a TreeView Table control
  • Finding out the row number of the collapsed/expanded row
  • Defining the next status during an addition
  • Finding out and modifying the images of the rows
  • Check Box treeview column
  • Finding out the parent or the children of an element
  • Properties specific to the TreeView Table controls
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The main concepts for programming the TreeViewTable controls are as follows. Several WLanguage functions allow you to manage the TreeView Table controls by programming.

Do not hesitate to see the documentation about these functions. See the list of functions for managing the TreeView Table controls for more details.

18版本和更高版本
WindowsLinux The TreeView Table control is now available for the WebDev sites.
18新版本
WindowsLinux The TreeView Table control is now available for the WebDev sites.
WindowsLinux The TreeView Table control is now available for the WebDev sites.

Initializing a TreeView Table control
To fill a TreeView Table control by programming, you have the ability to use the following functions:If a new row was added into a TreeView Table control by 表格添加, 表格插入, 表格添加行, 表格添加子行, 表格插入行 or 表格插入子行, the ..新建 property is set to (otherwise, it is set to ).

19版本和更高版本
WinDev Note: To optimize the filling of a TreeView Table control, you have the ability to use ..添加子元素 on the rows of the TreeView Table control.

In this case, the principle for filling the control is simplified:

  • When initializing the control, only the elements of the first level are loaded. Each element is associated with ..添加子元素.
  • When the user clicks the element of the first level to expand it, the procedure defined by ..添加子元素 is run. This procedure fills the level to expand. The search for children is performed only when the user wants to see them.
19新版本
WinDev Note: To optimize the filling of a TreeView Table control, you have the ability to use ..添加子元素 on the rows of the TreeView Table control.

In this case, the principle for filling the control is simplified:

  • When initializing the control, only the elements of the first level are loaded. Each element is associated with ..添加子元素.
  • When the user clicks the element of the first level to expand it, the procedure defined by ..添加子元素 is run. This procedure fills the level to expand. The search for children is performed only when the user wants to see them.
WinDev Note: To optimize the filling of a TreeView Table control, you have the ability to use ..添加子元素 on the rows of the TreeView Table control.

In this case, the principle for filling the control is simplified:

  • When initializing the control, only the elements of the first level are loaded. Each element is associated with ..添加子元素.
  • When the user clicks the element of the first level to expand it, the procedure defined by ..添加子元素 is run. This procedure fills the level to expand. The search for children is performed only when the user wants to see them.

Adding or modifying rows in a TreeView Table control

Adding rows into a TreeView Table control

The creation of a row in a TreeView Table control is not automatically performed. It must be explicitly requested via a call to:
WinDev Note: If the "Cascading input" option is not selected:
  • The TreeView Table control contains no row when it is created. In this case, no input can be performed. ..空 is set to .
  • To automatically insert a row into an empty TreeView Table control, use 表格添加 or 表格添加行.

Modifying a row or a column

The content of the rows and columns found in a TreeVview Table control can be modified:
  • by the user, by performing an input in the columns. The modifications are automatically stored in the treeview table without additional programming. ..已修改 is set to .
  • by programming:
表格修改TVT_CUSTOMER"MOORE"+TAB+"Vince"+TAB+"Miami"
Note: You also have the ability to use the name of the TreeView Table control directly:
// Modify the current row
TVT_CUSTOMER"MOORE"+TAB+"Vince"+TAB+"Miami"
// Modify the COL_DAY coloumn of row 3
表格修改COL_DAY"Wednesday"+TAB+"Off"3
  • by specifying the name of the column (like for an edit control) to modify the content of the column. To modify a column of a specific row, the number of the row must be specified (subscript).
For example:
COL_NAMESubscript】=CustomerName
To modify a column of the current row, there is no need to specify the subscript.
For example:
COL_NAMECustomerName
..已修改 is set to (it is set to when an input is performed in the treeview table).

WinDev

Resuming the input in a column

重新输入 can be used to go back to input in a column of the current row. For example:

// Entry process in the COL_QTY column
// COL_QTY cannot be entered if COL_PRODUCT is not entered
如果无空格COL_PRODUCT)="",那么
错误"The Product column must be entered first"
重新输入COL_PRODUCT
结束

WinDev

Adding or deleting a column

You can:

Managing the calculated columns

The calculation formula of a calculated column must be described in the "Displaying a table row" process. For example:

// COL_PBT: calculated column
// COL_UPBT and COL_QTY: columns linked to memory zones
COL_PBTCOL_UPBT*COL_QTY

Operations on the rows and cells

Deleting a row

The deletion of a row must be explicitly requested by 表格删除 and 表格删除子行.
表格删除(<Name of TreeView Table> [, <Subscript>])
If the subscript is specified, 表格删除 deletes the row corresponding to the subscript. Otherwise, the current row is deleted. Deleting a row from a treeview table deletes all the values of the columns for this row.
TableDeleteChild(<Name of TreeView Table>, <Subscript of Parent Element>)
All the child elements of the row identified by the subscript will be deleted.

Selecting a row

The selection of a row is performed by 表格选择行.

The following syntax is used:

表格选择行(<Name of TreeView Table>[, <Subscript>])

Retrieving the content of a row or the content of a cell

The content of a TreeView Table control can be retrieved:
  • for the entire row.
  • cell by cell.

Value of a cell in the current row

To retrieve the value of a column (or cell) for the current row, the syntax is the same as for a simple edit control.

<Value> = <Column_Name>

For example:

// COL_QTY is a column of the treeview table
如果COL_QTY小于10,那么
信息"Insufficient quantity"
结束

Value of a cell in a specific row

To retrieve the value of a column not found on the current row, the subscript of the row must be specified.

<Value> = <Column Name>[<Subscript>]

For example:

// Add the total price before tax (PBT) for all the order lines
TotalPrice0
对于Subscript1直到TVT_ORDERS..数目
TotalPriceTotalPrice+COL_PBTSubscript
结束

Content of the current row

To retrieve the content of the current row:

<Value> = <Name of TreeView Table>

Content of a specific row

To retrieve the content of the row whose subscript is <Subscript>:

<Value> = <Name of TreeView Table>[<Subscript>]

Note: the subscript of the current row is returned by 表格选定行. For example:

// Retrieve the row 10 in the TVT_CUSTOMER treeview table
CurrentRowTVT_CUSTOMER10
// Name of selected customer
CustomerNameCOL_NAME表格选定行TVT_CUSTOMER)】
// Retrieve the current row in the TVT_CUSTOMER treeview table
CurrentRowTVT_CUSTOMER

Operations on the tree structure

Collapsing all the nodes of a TreeView Table control

To collapse all the nodes of a TreeView Table control, use 表格收起全部. The following syntax is used:

TableCollapseAll(<Name of TreeView Table>)

Expanding all the nodes of a TreeView Table control

To expand all the tree nodes of a TreeView Table control, use 表格展开全部. The following syntax is used:

TableExpandAll(<Name of TreeView Table>)

19版本和更高版本
WinDev Note: If the TreeView Table control is using the delayed fill of sub-levels via ..添加子元素, the procedure for filling the sub-levels will be run for each new expanded element.
19新版本
WinDev Note: If the TreeView Table control is using the delayed fill of sub-levels via ..添加子元素, the procedure for filling the sub-levels will be run for each new expanded element.
WinDev Note: If the TreeView Table control is using the delayed fill of sub-levels via ..添加子元素, the procedure for filling the sub-levels will be run for each new expanded element.

Finding out the row number of the collapsed/expanded row

To find out the row number of the row that is expanded or collapsed, use the "Collapsed, expanded node" code of the Treeview Table control:

// Which row is used?
信息TVT_TreeviewTableTVT_TreeviewTable】)

Defining the next status during an addition

You have the ability to define the status of the next row that will be added into a TreeView Table control, which means collapsed or expanded. To do so, use ..收起.

// The next added rows will be automatically collapsed
TVT_TreeviewTable..收起=

Finding out and modifying the images of the rows

To find out and modify the images of the rows in a TreeView Table control, use the following properties:
// Modify the images of the rows in a treeview table
TVT_TreeviewTable..图片展开="OpenedFolder.gif"
TVT_TreeviewTable..图片收起="ClosedFolder.gif"

Check Box treeview column

A Check Box column can be defined as "TreeView column" in a TreeView Table control. In this case, the Check Box column can be used to manage the tree structure.

..标签 is used to find out and modify the caption found beside the check box.

..值 is used to find out and modify the value of the check box.

Finding out the parent or the children of an element

The following functions can be used to find out the parent or the children of an element:

Properties specific to the TreeView Table controls
The following properties are used to manage the characteristics of a TreeView Table control by programming.
19版本和更高版本
添加子元素
19新版本
添加子元素
添加子元素
Allows you to define the procedure that will be called later to fill a branch.
收起Allows you to define the status (collapsed or expanded) that will be used when adding new rows into a TreeView Table control.
合并Allows you to find out whether the cells (or the titles of columns) found in a TreeView Table control are merged and to merge the cells (or the titles of columns) found in a TreeView Table control.
图片展开Allows you to find out and modify the default image in an expanded row of a TreeView Table control.
图片收起Allows you to find out and modify the default image in a collapsed row of a TreeView Table control.
多重选择Allows you to find out and modify the selection mode of a TreeView Table control.
19版本和更高版本
全部分支数目
全部分支数目
Returns the total number of children for a branch in a TreeView Table control.
排序选项Allows you to find out and modify the sort options defined for a column in TreeView Table control.
左缩进Allows you to find out or modify the available space found on the left of the text in the columns of a TreeView Table control.
字段浏览Allows you to find out and modify the item used for the automatic browse of TreeView Table controls.
大小Allows you to find out and modify the number of columns in a TreeView Table control.
总计启用Allows you to find out the operating mode of automatic calculations in a TreeView Table control and to forbid or force the automatic calculations in a TreeView Table control.

To find out the entire list of WLanguage properties that can be used: