I have a table created by New-UDTable -OnRowExpand -loaddata with a uddynamic in the OnRowExpand area. When I try to go to the next page of the table, the rows are still expanded. Is there any way to collapse the rows when using the navigation buttons?
Maybe not the most elegant method, but you could probably save the current page number to a variable and compare that variable to the page in $EventData in your -LoadData ScriptBlock.
If they’re not equal, meaning -LoadData was triggered by a page change, then collapse all expanded rows.