Sort one Column and move other row cells accordingly

Hi:)
I want to sort my data table in ascending order( I have column 0) containing the numbers.
And then I want to move the other row cell values according to the sorting
Example:
Col 0 Col1 etc…
5 Hello
2 How are you
4 Good

What I want:
2 How are you
4 Good
5 Hello
How can I do that

1 Like

HI @Farah_halawani

How about this expression?

Dtinput.AsEnumerable().OrderBy(Function (row) row("Column1")).Select(Function (row) row).ToArray.CopyToDatatable()

Check out the XAML file

Orderby.xaml (7.2 KB)

Output

image

Regards
Gokul

Thank you So Much it works perfectly!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.