Replace new-udgrid content

is there a way to replace udgrid content
i want to have a blank udgrid and when a button is clicked the grid is populated
ived tried using set-udelement on the udgrids id and replacing the udgrid content or endpoint but that isnt working any help appreciated thanks

Hi @Srichman0128,

Makeshift solution: Use a session variable to decide if the data should be returned.

New-UDButton -Text "Populate" -onclick {
    $Session:Populate = $true
    Sync-UDElement -id "HiddenGrid"
New-UDGrid -id "HiddenGrid" -Endpoint {
    if ($Session:Populate) {
        $data | out-udgriddata
1 Like