Hi
As per your information from the comment, below solution may work for you.
you need to pass index of the column in the query to sort your data.
like
select * from table order by 1
above query will sort your table with order by first column. so from database you need to pass index of the column from the dropdown.
hope this will work for you
Best luck.