RVirtualTable class
public sealed class RVirtualTable : UserControlA read-only table that builds only the visible rows.
Constructors
RVirtualTable()An empty table.
Properties
List<string[]> Rows { get; }All the rows, in the order shown when not filtered.
string HeaderKey { get; set; }The theme resource of the header background («Bar»).
int ColumnCount { get; }How many columns.
int SelectedIndex { get; }The selected row of Rows (−1: none).
string[] SelectedRow { get; }The cells of the selected row (null: none).
int ShownCount { get; }How many rows are shown (after the filter).
IReadOnlyList<string[]> Shown { get; }The rows shown, in order (after sort and filter).
string Filter { get; set; }The words searched: only the rows with a cell that contains them (case not counted); the empty text shows every row.
Methods
RVirtualTable Columns(params string[] headers)The columns; «:R» right, «:C» center at the end of a header. The widths are measured again from the rows already there.
string Header(int column)The header of a column (without the alignment suffix).
RVirtualTable SetWidth(int column, double width)Sets the width of a column, dip (the measured one otherwise).
double ColumnWidth(int column)The width of a column, dip.
RVirtualTable AddRow(params string[] cells)Adds a row (missing cells are empty).
RVirtualTable AddRows(IEnumerable<string[]> rows)Adds many rows at once, measuring the widths again.
void Clear()Removes every row (the columns stay).
void LoadCsv(string text, bool headers = true)A CSV text (RCsv: commas, points, quotes): the first row gives the headers, the columns whose cells are all numbers go to the right. Without headers the columns are named A, B, C...
void Select(int row)Selects a row of Rows (−1: none) and scrolls to it, if it is shown.
void Sort(int column, bool descending = false)Sorts Rows by a column: by value if every cell that is not empty is a number (also «4k7», «1.5p»), else alphabetically.
string Text()The rows shown, with the headers, as text with tabs (RClipboard.SetText).
Events
event Action<int> SelectionChangedWhen the selection changes, with the row of Rows (−1: none).