API Reference
Class
Grid (Interactive)
An interactive table viewer: filter as you type, sort by column, page and scroll, mark rows, choose columns, and see a row's details. It returns the original objects of the chosen rows. Columns use the table's width negotiation and presenters; the screen has the same header bar, panel and footer as menus and forms.
Inheritance
- Object
- Grid
Constructors
public Grid(String title) #Creates a grid.
Parameters
- title System.String
- The title in the header bar.
Methods
AddColumn 2 overloads
public Grid AddColumn(TableColumn column) #Returns:
GridAdds a column.
Parameters
- column ConsoleMonster.Widgets.TableColumn
- The column (header, presenter, alignment, priority).
Returns
The grid.
public Grid AddColumn(String header, ICellPresenter? presenter = null) #Returns:
GridAdds a column by header.
Parameters
- header System.String
- The header.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter, or null for automatic formatting.
Returns
The grid.
public Grid AddRow(Object? item, params Object?[] values) #Returns:
GridAdds a row: the object it stands for and its raw column values.
Parameters
- item System.Object?
- The object returned when the row is chosen.
- values System.Object?[]
- The column values (formatted by the column presenters).
Returns
The grid.
public GridResult Show(GridOptions? options = null, CancellationToken cancellationToken = default) #Returns:
GridResultShows the grid and returns the chosen rows.
Parameters
- options ConsoleMonster.Interactive.GridOptions? = null
- The options, or null for the defaults.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the grid.
Returns
The result.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?
Properties
public GridSelection Selection { get; set; } #What the grid returns (default GridSelection.Multiple).
public PresentationOptions Presentation { get; set; } #Culture and display options for the presenters.