Adds automatic column resizing to ListViews

- Enables automatic horizontal and vertical scrollbars for ListViews in the UI to improve navigation.
- Introduces functions to dynamically calculate and apply column widths based on the visible content and header text.
- Triggers column auto-resizing across various modules whenever ListView data is updated or refreshed.
- Renames a path normalization function and updates an event handler parameter name for clarity.
This commit is contained in:
rbalsleyMSFT
2026-03-24 16:28:29 -07:00
parent bae29fd9c7
commit d6361dac4d
9 changed files with 251 additions and 8 deletions
@@ -182,6 +182,7 @@ function Add-BYOApplication {
# Refresh the ListView to show the changes
$listView.Items.Refresh()
Request-ListViewColumnAutoResize -ListView $listView
# Reset state
$State.Data.editingBYOApplication = $null
@@ -212,6 +213,7 @@ function Add-BYOApplication {
CopyStatus = ""
}
$listView.Items.Add($application)
Request-ListViewColumnAutoResize -ListView $listView
}
# Clear form and update button states for both add and update operations
@@ -285,6 +287,7 @@ function Add-AppsScriptVariable {
}
$State.Data.appsScriptVariablesDataList.Add($newItem)
$State.Controls.lstAppsScriptVariables.ItemsSource = $State.Data.appsScriptVariablesDataList.ToArray()
Request-ListViewColumnAutoResize -ListView $State.Controls.lstAppsScriptVariables
$State.Controls.txtAppsScriptKey.Clear()
$State.Controls.txtAppsScriptValue.Clear()
# Update the header checkbox state
@@ -311,6 +314,7 @@ function Remove-SelectedAppsScriptVariable {
$State.Data.appsScriptVariablesDataList.Remove($itemToRemove)
}
$State.Controls.lstAppsScriptVariables.ItemsSource = $State.Data.appsScriptVariablesDataList.ToArray()
Request-ListViewColumnAutoResize -ListView $State.Controls.lstAppsScriptVariables
# Update the header checkbox state
if ($null -ne $State.Controls.chkSelectAllAppsScriptVariables) {