Sorting grid with 2 data sources


I have been searching this question for days and i could not find any answer. My question is:
I have 2 data sources in my form. And i have a grid. This data sources are joined to each other with inner join. I have fields of both Data Source on my grid. Now i want to sort this grid with following order:


The grid Data Source is ds1.
How can i sort with this way?

Thanks a lot;