Check out the following thread:
http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7299
Although I think you already re-build your DynamicList upon sorting, in this case you may just use the following way:
ResultsetFields fields = new ResultsetFields(2);
fields.DefineField(CustomerFields.LastName, 0);
fields.DefineField(CustomerFields.FirstName, 1);
...
SortExpression sortExpression=new SortExpression( new SortClause(fields[x],SortOperator.Ascending));
And change the index x of the fields array in the sortClause constructor according to the clicked column.