DataGrid
ConsoleMonster.Interactive
A retained, embeddable grid. Each instance owns its cursor, viewport, search and marks; the application owns the terminal.
Inheritance
- InputControl
- DataGrid
Usage
Explore 41 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 21
- Extension method DataGrid.CurrentRow
- Extension method DataGrid.Cursor
- Extension method DataGrid.Disabled
- Extension method DataGrid.Filter
- Extension method DataGrid.Grid
- Extension method DataGrid.Height
- Extension method DataGrid.Label
- Extension method DataGrid.QuickSearch
- Extension method DataGrid.TabIndex
- Extension method DataGrid.ValidationMessage
- Method DataGridFluent.CurrentRow
- Method DataGridFluent.Cursor
- Method DataGridFluent.Disabled
- Method DataGridFluent.Filter
- Method DataGridFluent.Grid
- Method DataGridFluent.Height
- Method DataGridFluent.Label
- Method DataGridFluent.QuickSearch
- Method DataGridFluent.TabIndex
- Method DataGridFluent.ValidationMessage
- Method DataGridInputOptions.Build
Accepted by parameters 20
- Extension method DataGrid.CurrentRow
- Extension method DataGrid.Cursor
- Extension method DataGrid.Disabled
- Extension method DataGrid.Filter
- Extension method DataGrid.Grid
- Extension method DataGrid.Height
- Extension method DataGrid.Label
- Extension method DataGrid.QuickSearch
- Extension method DataGrid.TabIndex
- Extension method DataGrid.ValidationMessage
- Method DataGridFluent.CurrentRow
- Method DataGridFluent.Cursor
- Method DataGridFluent.Disabled
- Method DataGridFluent.Filter
- Method DataGridFluent.Grid
- Method DataGridFluent.Height
- Method DataGridFluent.Label
- Method DataGridFluent.QuickSearch
- Method DataGridFluent.TabIndex
- Method DataGridFluent.ValidationMessage
Constructors
public DataGrid(string key, Grid? grid = null) #Creates a grid over an existing listing, or an empty listing.
Parameters
- key string
- grid ConsoleMonster.Interactive.Grid? = null
Methods
public void Dispose() #Cancels pending cell factories when the control is permanently retired.
public void MarkPattern(string pattern, int column = 0) #Marks matching names in the current view. Asterisk matches any sequence and question mark one character.
Parameters
- pattern string
- column int = 0
public void RefreshRows() #Refreshes column, sort and filter mappings after changing the listing.
public bool SearchPrefix(string prefix, int column = 0) #Jumps to the first prefix match without forcing pending cell factories.
Parameters
- prefix string
- column int = 0
Returns
boolpublic void SetRows(IEnumerable<GridRow> rows) #Rebinds a listing while retaining the focused identity and surviving marks. Call on the app thread.
Parameters
- rows System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.GridRow>
public void Sort(int column, bool descending = false) #Sets the sort column; -1 restores listing order.
Parameters
- column int
- descending bool = false
public void ToggleMark(bool advance = false) #Toggles the current mark; optionally advances afterwards.
Parameters
- advance bool = false
public void UnmarkPattern(string pattern, int column = 0) #Unmarks matching names in the current view.
Parameters
- pattern string
- column int = 0
Inherited Methods
public bool HandleInput(InputEvent input, RenderContext context) #Parameters
- input InputEvent
- context RenderContext
Returns
boolpublic Size Measure(Constraints constraints, RenderContext context) #Parameters
- constraints Constraints
- context RenderContext
Returns
Sizepublic void Render(Region region, RenderContext context) #Parameters
- region Region
- context RenderContext
Properties
public Grid Grid { get; } #The listing and column definitions. Call RefreshRows after changing them.
public int Height { get; set; } #The maximum natural content height; constrained further by the host viewport.
public bool QuickSearch { get; set; } #Whether unbound text performs prefix search. Disable when an app registry owns search.
public GridRow? CurrentRow { get; } #The focused source row, or null for an empty view.
public string Filter { get; set; } #The active substring filter; words must match displayed columns.
public IReadOnlyList<object?> Marks { get; } #Marked original objects in display sort order, including filtered marks.
public int MarkCount { get; } #The number of marked identities, including filtered rows.
public IReadOnlyList<object?> Selection { get; } #The original objects selected by the grid's output mode.
Inherited Properties
Inherited Events
public event EventHandler<AppValueChangedEventArgs>? Changed #Extension Methods
public static DataGrid CurrentRow(DataGrid dataGrid, Action<GridRow> configure) #Configures DataGrid.CurrentRow in place: The focused source row, or null for an empty view.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- configure System.Action<ConsoleMonster.Interactive.GridRow>
- Configures the value.
public static DataGrid Cursor(DataGrid dataGrid, int value) #Sets DataGrid.Cursor: The focused visible row index.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.Cursor = value; dataGrid.Cursor(value);public static DataGrid Disabled(DataGrid dataGrid, bool value) #Sets InputControl.Disabled: Whether this control is excluded from input and focus traversal.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.Disabled = value; dataGrid.Disabled(value);public static DataGrid Disabled(DataGrid dataGrid) #Sets InputControl.Disabled to true.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance to configure.
public static DataGrid Filter(DataGrid dataGrid, string value) #Sets DataGrid.Filter: The active substring filter; words must match displayed columns.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.Filter = value; dataGrid.Filter(value);public static DataGrid Grid(DataGrid dataGrid, Action<Grid> configure) #Configures DataGrid.Grid in place: The listing and column definitions. Call RefreshRows after changing them.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- configure System.Action<ConsoleMonster.Interactive.Grid>
- Configures the value.
public static DataGrid Height(DataGrid dataGrid, int value) #Sets DataGrid.Height: The maximum natural content height; constrained further by the host viewport.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.Height = value; dataGrid.Height(value);public static DataGrid Label(DataGrid dataGrid, string? value) #Sets InputControl.Label: The visible label, or null to use the name.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.Label = value; dataGrid.Label(value);public static DataGrid QuickSearch(DataGrid dataGrid, bool value) #Sets DataGrid.QuickSearch: Whether unbound text performs prefix search. Disable when an app registry owns search.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.QuickSearch = value; dataGrid.QuickSearch(value);public static DataGrid QuickSearch(DataGrid dataGrid) #Sets DataGrid.QuickSearch to true.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance to configure.
public static DataGrid TabIndex(DataGrid dataGrid, int value) #Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.TabIndex = value; dataGrid.TabIndex(value);public static DataGrid ValidationMessage(DataGrid dataGrid, string? value) #Sets InputControl.ValidationMessage: The current validation message below the control, or null.
Parameters
- dataGrid ConsoleMonster.Interactive.DataGrid
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
dataGrid.ValidationMessage = value; dataGrid.ValidationMessage(value);