Setting a primary and a secondary sort in a grid is currently handled by using a combination of groupBy and sort (or OrderBy if using path query). 

Example Script

        <!--Enables grouping column number 1 which is HW Pin Type -->
        <Grouping groupBy="1"/>
        <AttributeColumn type="5PTZ" width="200" caption="HW Pin Type"/>
        <AttributeColumn type="5CON" width="200" caption="Connector"/>
    <ForEach select="/ITWB" sort="Attribute:5PTZ">

Example Result

To select particular items that you want to work with, you can also apply a custom filtering via the Filter tool: