Table of Contents

Interface ITableDataSource

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Interface for virtual/lazy data binding to a TableControl. Enables large datasets (millions of rows) without memory overhead by querying only visible rows on demand.

public interface ITableDataSource : INotifyCollectionChanged
Inherited Members
Extension Methods

Properties

CanFilter

Gets whether the data source supports server-side filtering.

bool CanFilter { get; }

Property Value

bool

ColumnCount

Gets the total number of columns in the data source.

int ColumnCount { get; }

Property Value

int

RowCount

Gets the total number of rows in the data source.

int RowCount { get; }

Property Value

int

Methods

ApplyFilter(string, string?, FilterOperator)

Applies a filter to the data source.

void ApplyFilter(string filterText, string? columnName, FilterOperator op)

Parameters

filterText string
columnName string
op FilterOperator

CanSort(int)

Gets whether the data source supports sorting on the specified column.

bool CanSort(int columnIndex)

Parameters

columnIndex int

Returns

bool

ClearFilter()

Clears any active filter on the data source.

void ClearFilter()

GetCellValue(int, int)

Gets the cell value at the specified row and column.

string GetCellValue(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

string

GetColumnAlignment(int)

Gets the text alignment for a column.

TextJustification GetColumnAlignment(int columnIndex)

Parameters

columnIndex int

Returns

TextJustification

GetColumnHeader(int)

Gets the header text for a column.

string GetColumnHeader(int columnIndex)

Parameters

columnIndex int

Returns

string

GetColumnWidth(int)

Gets the fixed width for a column. Null means auto-width.

int? GetColumnWidth(int columnIndex)

Parameters

columnIndex int

Returns

int?

GetRowBackgroundColor(int)

Gets the background color for a row. Null means use table default.

Color? GetRowBackgroundColor(int rowIndex)

Parameters

rowIndex int

Returns

Color?

GetRowForegroundColor(int)

Gets the foreground color for a row. Null means use table default.

Color? GetRowForegroundColor(int rowIndex)

Parameters

rowIndex int

Returns

Color?

GetRowTag(int)

Gets an arbitrary tag object for a row.

object? GetRowTag(int rowIndex)

Parameters

rowIndex int

Returns

object

IsRowEnabled(int)

Gets whether a row is enabled for interaction.

bool IsRowEnabled(int rowIndex)

Parameters

rowIndex int

Returns

bool

Sort(int, SortDirection)

Sorts the data source by the specified column and direction.

void Sort(int columnIndex, SortDirection direction)

Parameters

columnIndex int
direction SortDirection