Page 1 of 1

Load data after SelectedIndexChange

Posted: Wed Jun 02, 2021 12:23 pm
by apowershelluser
I have two CSVs I import on load
$Users - Contains UsersNames, UsersID,State
$Assets - Contains PCNumbers, Model, Serial

I have $users loaded into a combobox
Update-ComboBox -ComboBox $comboboxNames $CSV.DisplayName

On SelectedIndexChanged, is there a way I can get the UserID to query the $Assets CSV?

Re: Load data after SelectedIndexChange

Posted: Sun Jun 06, 2021 12:04 am
by jvierra
What have you tried?

You have given no information that can help guess at any possible answer.

When loading a Combobox with objects load the whole object then when an even occurs you will know the exact object and all properties.

No idea what you mean by "query" a CSV. A CSV is a tectfile. Loaded as an object you can filter it on a property of a row.

Re: Load data after SelectedIndexChange

Posted: Mon Jun 07, 2021 9:45 am
by apowershelluser
When you step away and go duh
$Assets | Where-Object { $_.UserID -contains $comboboxNames.SelectedItem.Shortname }

I got it :)