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

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



Example Result


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