Cmdlet
New-ConsoleDataGrid
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 SetsDescription
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 18Embed an existing listing.
Parameters
- -Disabled SwitchParameter
- Disables editing and removes the input from keyboard focus traversal.
- -Grid Grid
- The listing's columns, original objects and row identities.
- -Height Int32
- Natural content height; the terminal viewport can constrain it further.
- -Key String
- Unique key in the application's state and final hashtable.
- -Label String
- Visible label; defaults to the name using the core control's labels.
- -NoQuickSearch SwitchParameter
- Leaves printable keys to the app's command registry.
- -OnChange ScriptBlock
- 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
- Keyboard focus order. Equal values preserve layout declaration order.
- -ValidationMessage String
- 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.