How to sort data table based on custom list

I have a data table that I need to sort based on a custom list. Given the data table shown below:

NAME                     TITLE
Ray                         developer
Gina                        manager
Alex                         QA

How do i sort based on the custom list below?

CUSTOM LIST
Gina
Alex
Ray

One of more options to implement a custom sort

myOrderList | List(of String) =
{"GINA","ALEX","RAY"}.Reverse().toList

Assign Activity:
dtOrdered =

(From d in YourDataTableVar.AsEnumerable
Let v = d("NAME").toString.ToUpper.Trim
Order by myOrderList.IndexOf(v) DESCENDING
Select r = d).CopyToDataTable
1 Like