How do I add a transient field to a list grid?

We can achieve this by extending the controller and overriding the modifyEntityForm(...). Once this is setup, you'll be able to grab the Tab where your ListGrid lives from the EntityForm and pull the ListGrid off of it.

Something like this should work (adjusted to your
ListGrid on your
Controller):

One key thing to note is the ordering. While clearing the FieldMap will reset the ordering on the record fields there can be situations where the HeaderFields will ultimately define the ordering first. In this case, simply setting the order will NOT work. This is because the headerFields is a TreeSet that is ordered very specifically when fields get added. Since the fields are then changing after the fact, it is not getting ordered correctly.

Considering that, the best way to do keep the ordering needed we need to do one of the following options:

A) Alter the headerFieldsTreeSet by removing the field, changing the order on the field, and then adding it back in. B) Create a new TreeSet with the same Comparator, add all the fields in after changing the order and then setting the new TreeSet on the ListGrid.