powershell-universal
powershell-universal copied to clipboard
datagrid type "smart" singleSelect
Summary of the new feature / enhancement
It would be nice if we could have a datagrid type singleSelect which is "smart" currently you have to configure the ValueOptions manually, but it would be nice if its created automaticly from the unique values from the column
Proposed technical implementation details (optional)
create the valueoptions automaticly from the unique values from the column and sorted. So we can have a dropdown to filter
@adamdriscoll can this be in 4.5.0 ?
Any chance to fix this ? @adamdriscoll
The problem is that the data grid doesn't know the full set of options. I actually think it used to work as you were describing but, if for example, the data grid only contains rows (due to paging, sorting, filtering) with 1,2,3 for the selectable column, that's all that would show in the drop down. Even if there were actually 4,5,6 in the data source itself.
It's possible we could make this behavior configurable so it worked how it did before, but the limitation would remain.
ok I think I understand, but one thing I don't understand... when you currently use paging, or sort you are also able to filter to whole datagrid...or am I wrong. I understand though, when using a filter, the dropdown only shows the available options (1,2,3)
We are able to filter the whole grid since we are receiving the values from the end user. Since we don't know how to query the backend data, we can't actually formulate a list of values the end user can select. If we knew that the backend was using SQL, then we could perform that SQL query for the list of available items automatically but since we don't know how to query it, we can provide that functionality.
I do think that it would make sense to create some wrapper tables for common data sources, like SQL. Then you could point the wrapper at a table\database and it would automatically provide all that functionality without having to do it manually. We could also provide the same if a set of objects was provided.
It's probably something I would implement in the Gallery.
I made an issue there about it: https://github.com/ironmansoftware/gallery/issues/112
@adamdriscoll ok thanks,
Can you check current implementation? it looks like filtering doesn't work with -Type singleSelect -ValueOptions <String[]>