No programming is needed for this, but you do need to either a) modify the view.xsl, or b) use our qRules add-on that has a command for sorting.
The first approach (modifying the xsl to include an xsl:sort operator) requires exporting the XSN as source files and then opening up view.xsl (or whichever view you have the control in). Search for the control. You'll have to add the custom xsl:sort attribute and that can be a little tricky. I am guessing there are a lot of examples in this forum if you search. I believe Greg Collins may have uploaded a sample too. If you can't find them, please send me email.
The second approach is easier (but it does require our qRules library). You can download a free trial of qRules from the Qdabra dot com web site and it will install a user guide that has an example of how to use the sort command.
Best of luck,
Patrick