Class DataTable
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Virtualized multi-column table (preset browsers, sample lists, modulation matrices): sortable headers with arrows, resizable columns, striped rows, single or extended selection, keyboard navigation, horizontal and vertical scrolling, and in-place editing of editable columns (double-click or F2).
public class DataTable : Control
- Inheritance
-
DataTable
- Inherited Members
Remarks
Constructors
DataTable()
Creates an empty table.
public DataTable()
Properties
Columns
Columns.
public List<DataColumn> Columns { get; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
EmptyText
Text shown when there are no rows.
public string? EmptyText { get; set; }
Property Value
HeaderHeight
Header height (0 = no header).
public float HeaderHeight { get; set; }
Property Value
Items
Row items.
public IList? Items { get; set; }
Property Value
MultiSelect
Extended selection (Ctrl / Shift).
public bool MultiSelect { get; set; }
Property Value
RowCount
Number of rows.
public int RowCount { get; }
Property Value
RowHeight
Row height.
public float RowHeight { get; set; }
Property Value
SelectedItem
First selected item (null = none).
[Browsable(false)]
public object? SelectedItem { get; set; }
Property Value
SelectedItems
Selected row items (in view order).
public IEnumerable<object> SelectedItems { get; }
Property Value
ShowGridLines
Vertical lines between columns.
public bool ShowGridLines { get; set; }
Property Value
SortColumn
Sort column (null = items order).
[Browsable(false)]
public DataColumn? SortColumn { get; }
Property Value
SortDescending
Descending sort.
[Browsable(false)]
public bool SortDescending { get; }
Property Value
Striped
Alternate row shading.
public bool Striped { get; set; }
Property Value
Methods
AddColumn(DataColumn)
Adds a column (fluent).
public DataTable AddColumn(DataColumn column)
Parameters
columnDataColumn
Returns
BeginEdit(int, int)
Starts editing a cell (view row index, column index) if the column is editable.
public void BeginEdit(int viewRow, int column)
Parameters
LayoutParts(VectorStyle, out Rect, out Rect, out Rect)
Splits the bounds into label (top), widget and value (bottom) areas according to the style. Override to change the arrangement (e.g. label on the left for sliders).
protected override void LayoutParts(VectorStyle style, out Rect label, out Rect widget, out Rect value)
Parameters
styleVectorStylelabelRectwidgetRectvalueRect
OnCaptureLost()
The mouse capture was lost without a button release.
protected override void OnCaptureLost()
OnKeyDown(KeyEventArgs)
Key pressed while focused (bubbles to parents).
protected override void OnKeyDown(KeyEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseLeave()
The mouse left the element.
protected override void OnMouseLeave()
OnMouseMove(MouseEventArgs)
Mouse moved over the element (or captured).
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnMouseWheel(MouseEventArgs)
Mouse wheel over the element.
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
OnRenderOverlay(DrawingContext)
Draws the keyboard focus ring.
protected override void OnRenderOverlay(DrawingContext dc)
Parameters
Refresh()
Re-reads the items (after adding, removing or editing rows).
public void Refresh()
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle
ScrollRowIntoView(int)
Scrolls so that a row (view index) is visible.
public void ScrollRowIntoView(int view)
Parameters
viewint
Sort(DataColumn?, bool)
Sorts by a column (null = items order).
public void Sort(DataColumn? column, bool descending = false)
Parameters
columnDataColumndescendingbool
Events
RowActivated
Raised on double-click (non-editable cell) or Enter with the row item.
public event Action<DataTable, object>? RowActivated
Event Type
SelectionChanged
Raised when the selection changes.
public event Action<DataTable>? SelectionChanged
Event Type
SortChanged
Raised when the sort changes.
public event Action<DataTable>? SortChanged