Skip to content
ConsoleMonster
Cmdlet

New-ConsoleDataGrid

Module
ConsoleMonster
Inputs
None
Outputs
ConsoleMonster.Interactive.DataGrid

Creates a named, embeddable data grid for Show-ConsoleApp.

Syntax

New-ConsoleDataGrid
[-Disabled]
-Grid <Grid>
[-Height <Int32>]
[-Key] <String>
[[-Label] <String>]
[-NoQuickSearch]
[-OnChange <ScriptBlock>]
[-TabIndex <Int32>]
[-ValidationMessage <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

The listing retains original objects and stable row identities. Each grid has its own cursor, marks and prefix search. Rows and lazy cells are rendered through the shared DataGrid control.

Examples

Example 1

New-ConsoleDataGrid -Key Left -Grid $listing -Height 18

Embed an existing listing.

Parameters

-Disabled SwitchParameter optional
Disables editing and removes the input from keyboard focus traversal.
-Grid Grid required
The listing's columns, original objects and row identities.
-Height Int32 optional
Natural content height; the terminal viewport can constrain it further.
-Key String requiredposition: 0
Unique key in the application's state and final hashtable.
-Label String optionalposition: 1
Visible label; defaults to the name using the core control's labels.
-NoQuickSearch SwitchParameter optional
Leaves printable keys to the app's command registry.
-OnChange ScriptBlock optional
Runs once per committed edit on the owning input thread. Receives param($Value, $State) and injected $Value, $State and $Control. State is a hashtable; add or assign keys to write back. Output is discarded. Retains closure variables.
-TabIndex Int32 optional
Keyboard focus order. Equal values preserve layout declaration order.
-ValidationMessage String optional
Initial validation text displayed below the input.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.