NE.Standard

Table

A table that shows the rows of a keyed collection under a header, one template per column.

TableComponent · type key standard.table · Items · property blocks: IBorderedComponent, ISurfaceStyleComponent, IScrollableComponent, ISelectableItemsComponent, ISelectionStyleComponent, IRowHoverableComponent

new TableComponent("table")

Properties

PropertyTypeDefaultBindingDescription
Own
BorderThickness
SetBorderThickness · BindBorderThickness
UIThickness?1one-wayThe border thickness; the table draws an edge by default.
ColumnsIReadOnlyList<UITableColumn>nullThe columns in order; each one's cell template is the table's template variant keyed by the column.
Render-time only: the columns are how the table is built.
ShowHeader
SetShowHeader · BindShowHeader
bool?trueone-wayWhether the header row of captions is shown.
Striped
SetStriped · BindStriped
bool?falseone-wayWhether every other row is tinted.
ShowColumnSeparators
SetShowColumnSeparators · BindShowColumnSeparators
bool?falseone-wayWhether a line is drawn between columns.
ShowRowSeparators
SetShowRowSeparators · BindShowRowSeparators
bool?trueone-wayWhether a line is drawn between rows.
ResizableColumns
SetResizableColumns · BindResizableColumns
bool?falseone-wayWhether the viewer may drag a column's edge in the header to resize it; the widths stay on the client.
ReorderableColumns
SetReorderableColumns · BindReorderableColumns
bool?falseone-wayWhether the viewer may drag a column by its caption to another place among the columns; the order stays on the client, as the widths do. A pinned column and a control's own column keep their places.
HostModeUIItemsHostModeUIItemsHostMode.PlainHow the host holds its rows. Set by Virtualized() or by binding a source, never directly.
WindowSize
SetWindowSize
int50How many rows one window holds; not bindable, the client reads it once.
WindowOffsetint?nullWhere the realized window starts, as the source last reported it. This and the three below are bound by the compiler only; binding one by hand is refused.
WindowTotalCountint?nullHow many items the source holds, as it last reported.
WindowHasMoreBeforeboolfalseWhether the source has items before the realized window.
WindowHasMoreAfterboolfalseWhether the source has items after the realized window.
WindowAggregatesIReadOnlyDictionary<string, object>nullWhat the source computed over every item the query leaves, by item property, as it last reported; bound by the compiler only.
BorderColor
SetBorderColor · BindBorderColor
UIThemeColor?nullone-wayThe border's colour, written as CSS border-color; unset leaves the stylesheet's own.
BorderRadius
SetBorderRadius · BindBorderRadius
UICornerRadius?nullone-wayThe corner rounding, written as CSS border-radius; unset leaves the stylesheet's own.
Surface
SetSurface · BindSurface
UISurfaceStyle?UISurfaceStyle.Backgroundone-wayWhat the component is made of.
HorizontalScroll
SetHorizontalScroll · BindHorizontalScroll
UIScrollMode?UIScrollMode.Disabledone-wayWhether the viewport scrolls horizontally — Disabled, Auto, or Always; default Disabled.
VerticalScroll
SetVerticalScroll · BindVerticalScroll
UIScrollMode?UIScrollMode.Autoone-wayWhether the viewport scrolls vertically — Disabled, Auto, or Always; default Auto.
ScrollSnap
SetScrollSnap · BindScrollSnap
UIScrollSnapMode?UIScrollSnapMode.Disabledone-wayWhether a scroll comes to rest on a child's edge rather than wherever it was let go.
ScrollAnchor
SetScrollAnchor · BindScrollAnchor
UIScrollAnchor?UIScrollAnchor.Noneone-wayHow the viewport reacts when its content grows, applying to the component's own scrolling element so it also works for a windowed host that a wrapping ScrollContainer could not reach.
SelectionMode
SetSelectionMode · BindSelectionMode
UISelectionMode?UISelectionMode.Noneone-wayHow many rows may be chosen at once.
SelectedKey
SetSelectedKey · BindSelectedKey
stringnulltwo-wayThe key of the chosen row under UISelectionMode.One.
SelectedKeys
SetSelectedKeys · BindSelectedKeys
IReadOnlyList<string>nulltwo-wayThe keys of the chosen rows under UISelectionMode.Many, in the order they were chosen.
SelectionStyle
SetSelectionStyle · BindSelectionStyle
UISelectionStyle?nullone-wayWhat a chosen item looks like. Unset, and every unset part of it, is the control's own default.
RowHoverable
SetRowHoverable · BindRowHoverable
bool?falseone-wayWhether rows highlight under the pointer; off by default unless the host turns it on for itself.
From ItemsComponentBase
Items
SetItems · BindItems
IReadOnlyList<IBindableItem>nullone-wayThe component items.
ItemsView
BindItemsView
UIItemsViewnullone-wayFiltering and sorting rules applied to the items collection.
Query
SetQuery · BindQuery
UIItemsQuerynulltwo-wayThe terms the viewer set after the view compiled — a header's sort, a filter row — applied beside the authored rules; bound both ways, so a windowed source is asked with them and a controller can set them.
From TemplatedComponentBase
TemplateKeyProperty
SetTemplateKeyProperty · BindTemplateKeyProperty
stringnullone-way, relative scopeThe name of the item field whose value selects a named template variant.
FallbackTemplateKey
SetFallbackTemplateKey
stringnullThe fallback template key used when ITemplatedComponent.TemplateKeyProperty does not resolve to a template.

Events

OnRowClickWithItem(string command, string argumentName = "item")
Registers a row click command that passes the current item as an argument.
OnRowClickWithItemKey(string command, string argumentName = "id")
Registers a row click command that passes the current item's key as an argument.
OnRowClick(string command)
Registers a click command invoked when a row is clicked.
OnRowClick(string command, params KeyValuePair<string, UIActionArgument>[] arguments)
Registers a click command invoked when a row is clicked, with UI action arguments.
OnRowClickLiteral(string command, params KeyValuePair<string, object>[] arguments)
Registers a click command invoked when a row is clicked, with literal argument values.
OnRowOpenWithItemKey(string command, string argumentName = "id")
Registers a command invoked when a row is opened — Enter on the keyboard's row, or a double click — with the row's key.
OnRowOpen(string command, params KeyValuePair<string, UIActionArgument>[] arguments)
Registers a command invoked when a row is opened — Enter on the keyboard's row, or a double click.
OnRowRemoveWithItemKey(string command, string argumentName = "id")
Registers a command invoked when the Delete key is pressed on a row that may be removed, with the row's key; the controller removes the row or leaves it.
OnRowRemove(string command, params KeyValuePair<string, UIActionArgument>[] arguments)
Registers a command invoked when the Delete key is pressed on a row that may be removed.

Methods

AddColumn(string caption, IVisualComponent template, UIGridUnit? width = null, UITextAlignment? alignment = null, string key = null, bool pinned = false)
Adds a column whose cells render template against the row: bind it relatively to the row's properties. The track is UIGridUnit.Auto unless given, and the key names the column's template variant. A pinned column stays in place while a wide table scrolls sideways; pinned columns lead the table.
Virtual, as TableComponent.AddTextColumn is: a package's grid builds its own column through the same verb.
HideColumnBelow(string key, UIResponsiveTier tier)
Hides the column keyed key while the viewport is narrower than tier; a viewer's chooser may still show it. The column is named after it is added, so the adding verbs stay short.
AddTextColumn(string caption, string propertyPath, UIGridUnit? width = null, UITextAlignment? alignment = null, string key = null, bool pinned = false)
Adds a column showing the row's text at propertyPath — a string property, in the row's own words.
Virtualized()
Keeps only the rows in view in the document, for a collection the client holds whole.
BindSource(string path, UIBindingScope scope = UIBindingScope.Root)
Binds the table's rows to a windowed source on the controller.
The path names the source; the compiler appends the property holding its realized window.
SetRowTemplate(DefaultRowTemplate template)
Sets the row template.
AddItem(IBindableItem item)
Adds an item to the component.
AddItems(IEnumerable<IBindableItem> items)
Adds items to the component.
FilterBy(UIProperty source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)
Adds a filter controlled by a local component property.
Defaults to a case-insensitive substring match; pass the operator explicitly where case matters.
FilterBy(string sourceComponentId, UIProperty source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)
Adds a filter controlled by another component property.
FilterBy(UIPropertyReference source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)
Adds a filter controlled by a property reference.
FilterBy(string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, object value = null)
Adds an unconditionally active filter with no source, comparing against a constant value.
SortBy(UIProperty source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)
Adds a sort rule controlled by a local component property.
SortBy(string sourceComponentId, UIProperty source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)
Adds a sort rule controlled by another component property.
SortBy(UIPropertyReference source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)
Adds a sort rule controlled by a property reference.
SortBy(string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, int priority = 0)
Adds an unconditionally active sort rule with no source.
SetEmptyTemplate(IVisualComponent visualTemplate)
Sets the template used when there are no items or no content.
Common properties (16) — layout, visibility, theme, and the rest every component shares
PropertyTypeDefaultBindingDescription
Visibility
SetVisibility · BindVisibility
UIResponsive<UIVisibility>?Visibleone-wayWhat the component does with the room it was given, optionally overridden per breakpoint (e.g. collapsed from a given width up).
Enabled
SetEnabled · BindEnabled
bool?trueone-wayWhether the component responds to input; false dims it and marks it, and its subtree, inert.
Theme
SetTheme · BindTheme
UIThemeMode?nullone-wayThe theme mode forced on this component's subtree, or null to inherit the ambient theme.
HorizontalAlignment
SetHorizontalAlignment · BindHorizontalAlignment
UIAlignment?UIAlignment.Stretchone-wayWhere the component sits within its grid cell along the horizontal axis.
VerticalAlignment
SetVerticalAlignment · BindVerticalAlignment
UIAlignment?UIAlignment.Stretchone-wayWhere the component sits within its grid cell along the vertical axis.
Width
SetWidth · BindWidth
UIResponsive<UILayoutLength>?nullone-wayThe component width, optionally overridden per breakpoint.
MinWidth
SetMinWidth · BindMinWidth
UIResponsive<UILayoutLength>?nullone-wayThe component minimum width, optionally overridden per breakpoint.
MaxWidth
SetMaxWidth · BindMaxWidth
UIResponsive<UILayoutLength>?nullone-wayThe component maximum width, optionally overridden per breakpoint.
Height
SetHeight · BindHeight
UIResponsive<UILayoutLength>?nullone-wayThe component height, optionally overridden per breakpoint.
MinHeight
SetMinHeight · BindMinHeight
UIResponsive<UILayoutLength>?nullone-wayThe component minimum height, optionally overridden per breakpoint.
MaxHeight
SetMaxHeight · BindMaxHeight
UIResponsive<UILayoutLength>?nullone-wayThe component maximum height, optionally overridden per breakpoint.
ZIndex
SetZIndex · BindZIndex
int?0one-wayThe stacking order within the visual tree.
Margin
SetMargin · BindMargin
UIResponsive<UIThickness>?nullone-wayThe outer spacing around the component, optionally overridden per breakpoint.
Placement
SetPlacement · BindPlacement
UIResponsive<UIGridPlacement>?nullone-wayThe grid placement, optionally overridden per breakpoint.
Loading
SetLoading · BindLoading
bool?falseone-wayWhether the component is in loading state — a live state a controller turns on and off.
ShowContextMenu
SetShowContextMenu · BindShowContextMenu
bool?trueone-wayWhether a right-click opens the IVisualComponent.ContextMenu; on a host with rows, whether it opens any row's. Off, the menu stays in the tree and nothing opens it.