New-UDDataGrid; custom column no field?

we select sql data and populate a New-UDDataGrid, which all works great. We would like to have another couple of columns whose data is derived from the values of one or more columns of the SQL data. Is this possible as we do not want to specify a field in the column list.

So for example from SQL we have say
@{ field = “company”;HeaderName=“company” }
then we would like to render a second column which as some psuedo logic like
if ($eventdata.company -eq ‘foo’) {new-udhtml “run its foo!”} else {new-udhtml “chill”}

the problem we have is that we need to specifiy a Field in the column definition.

doh! it’s simple, field can be anyting
@{ field = “More”;HeaderName=“More”;render = {New-UDButton -Text ‘More’ -OnClick {
}
}}

1 Like