Table of Contents

Class BOBDataCollectionClipboardSerializer<TItem>

Namespace
BlazOrbit.Components
Assembly
BlazOrbit.dll

Serializes a snapshot of a data collection (rows + visible columns) to the two clipboard payloads expected by spreadsheet applications:

  • text/plain as TSV — Excel, Sheets, Numbers and plain editors all consume tab-separated values directly.
  • text/html as a <table> — preserves cell typing when the destination's HTML clipboard reader is preferred (Excel especially: numbers stay numbers, dates stay dates, leading-zero strings survive).
Both forms write the same logical grid; the HTML variant additionally escapes special characters so a cell value containing markup cannot break out of the table envelope.
public static class BOBDataCollectionClipboardSerializer<TItem>

Type Parameters

TItem

Row item type, matching the parent data collection.

Inheritance
object
BOBDataCollectionClipboardSerializer<TItem>

Methods

BuildHtml(IEnumerable<TItem>, IEnumerable<DataColumnRegistration<TItem>>, bool)

Builds an HTML <table> payload from items using the visible subset of columns. Cell values are HTML-encoded so embedded markup cannot escape the cell. Numbers and dates are emitted via their formatted text only — Excel infers the cell type from the formatted value, so a numeric-looking string pastes as a number.

public static string BuildHtml(IEnumerable<TItem> items, IEnumerable<DataColumnRegistration<TItem>> columns, bool includeHeaders = true)

Parameters

items IEnumerable<TItem>

Row snapshot to serialise.

columns IEnumerable<DataColumnRegistration<TItem>>

Column definitions; Visible == false columns are skipped.

includeHeaders bool

When true, wraps a <thead> with one <th> per visible column.

Returns

string

BuildTsv(IEnumerable<TItem>, IEnumerable<DataColumnRegistration<TItem>>, bool)

Builds a TSV payload from items using the visible subset of columns. Tabs and newlines inside cell values are neutralised to spaces so the embedded character does not break TSV row/column structure when pasted.

public static string BuildTsv(IEnumerable<TItem> items, IEnumerable<DataColumnRegistration<TItem>> columns, bool includeHeaders = true)

Parameters

items IEnumerable<TItem>

Row snapshot to serialise. Typically the current filtered / sorted view, not the full underlying source.

columns IEnumerable<DataColumnRegistration<TItem>>

Column definitions; Visible == false columns are skipped.

includeHeaders bool

When true, prepends a header row with each column's Header string. Null headers serialise as empty cells.

Returns

string