
Table Column
Used to display multiple pieces of data with similar structures, data can be sorted, filtered, compared or other custom operations.
Add column header display name by setting Text
Demo
The fields in the table component TableColumns
template are automatically displayed according to the DisplayName
tag value of the bound model. If you want to customize the display name, please set Text
property
Add the first column of the table by setting IsMultipleSelect="true"
to select the column, and the ShowRowCheckboxCallback
callback delegate can control whether each row displays the checkbox. In this example, the Complete
attribute to control whether to display the checkbox
Demo
By setting ShowCheckboxText=true
the display text in the first column of the table is select
Demo
RowTemplate
internal component TableCell
set Checkbox
and set related data binding. In this example, data binding will select The box component is bound to the value
Demo
By setting the TableColumn
Width
property, the column width is controlled, and the inline button operation column width is controlled by the ExtendButtonColumnWidth
property
Demo
Continue the previous example in this example, implement four custom function buttons, and extend them to the row. When each button is clicked, there is a corresponding callback delegate method. TableToolbarButton
uses It is the way of Delegate
to complete the data exchange. When the toolbar button is clicked, set the OnClick
delegate method to obtain the selected row data set in the table
Continue the previous example in this example, implement four custom function buttons, and extend them to the row. When each button is clicked, there is a corresponding callback delegate method. TableToolbarButton
uses It is the way of Delegate
to complete the data exchange. When the toolbar button is clicked, set the OnClick
delegate method to obtain the selected row data set in the table
Control whether the button is displayed by setting the button IsShow
parameter
Customize the Template
template of the TableColumn
column to implement any UI
Demo
In this example, the column DateTime
value is displayed in different colors depending on whether the Complete
value is true
In this example, the column Complete
is displayed as a Checkbox
component according to the value of Complete
Template
template comes with Context
associated context, its value is of type TableColumnContext
Value
is the data value of the currently bound columnRow
is the data value of the row where the currently bound column is located
Format the cell value by specifying the FormatString
or Formatter
callback delegate when the column is bound
Demo
In this example the column DateTime
values are formatted according to FormatString
to yyyy-MM-dd
year month day format
In this example the column Count
value is formatted according to Formatter
to 0.00
with two decimal places
Set the alignment by specifying the Align
attribute when the column is bound
Demo
In this example the column DateTime
is set to center alignment Alignment.Center
In this example the column Count
is set to right-align Alignment.Right
Set whether to display at different widths by specifying the ShownWithBreakPoint
attribute
Demo
ShownWithBreakPoint
enumeration value:
None
is displayed if not setSmall
is displayed when the screen is greater than or equal to576px
Medium
is displayed when the screen is greater than or equal to768px
Large
is displayed when the screen is greater than or equal to992px
ExtraLarge
is displayed when the screen is greater than or equal to1200px
In this example, the Count
column is set to BreakPoint.Large
, that is, the screen will only be displayed when it is larger than 992px
Note:
Because the Table
component supports mobile adaptation by default, the card mode is used for small screens. In this example, the explicit setting uses RenderMode="TableRenderMode. Table"
mode
Set whether the column is displayed by specifying the ShowColumnList
attribute
Demo
ShowColumnList
The default value is false, and if it is explicitly specified as true, the corresponding column adjustment button will appear in the toolbar
TableColumn
adds the Visiable
property, its default value is true, this column will not be displayed when the display is set to false
In this example, the quantity column is not displayed by setting Visible
, and it can be displayed through the column control button
Trigger the OnColumnVisibleChanged
callback when switch the column state Show/Hide
Call the instancel method ResetVisibleColumns
of Table
for set the multiple columns visible value
Set table columns to allow resizing by specifying AllowResizing
Demo
Column resizing can only be done when the screen is too small and the scroll bar appears
Set ShowCopyColumn
show the icon for copy entire column data
Demo
可以通过设置 ShowCopyColumnTooltip
CopyColumnTooltipText
CopyColumnCopiedTooltipText
等设置微调拷贝列数据图标的 Tooltip
相关参数
By specifying Template
set the last column to display as a custom button
Demo
By specifying the AutoGenerateColumns
property value as true
, enable the function of automatically generating column information based on the binding model
Demo
In this example, by setting the value of AutoGenerateColumns
to true
, the automatic column generation function is enabled. All attributes of the bound model entity class are all generated by default. code>AutoGenerateColumnAttribute tag class for function settings, such as:
Ignore
means ignore this property, i.e. not generateReadonly
means read only- For more attributes, see Source code
date
column is formatted through the [AutoGenerateColumn(Order = 1, FormatString = "yyyy-MM-dd")]
tag; Set the template column in the code to customize the Complete
column and use the Switch
component to render; through the [AutoGenerateColumn(Order = 10)]
tag in the Order
set the display orderBy specifying OnColumnCreating
callback, make secondary data changes to the column collection
Demo
Custom rendering of columns by showing template Template
Demo
B station related video link
交流群