I have values which are numeric and string values. lets say 1,2 ,3 and like xc1,xc2 . I want to sort these values. First sorting numeric ones than none numeric ones. How can I do this with dataview or dataset
Thanks too much.
,
I don't believe it's possible to create your own sort order for a DataView or DataSet.
If you can get the information into an Array, you can write your own IComparer to use in Array.Sort. In fact, you could create yourself an array of pairs (rowIndex, key). You could then sort the array on the key using your custom IComparer implementation. You could then create a new DataTable by running through the sorted array, picking up the original row (by the rowIndex), and adding it to the new table. This new table would then be in the correct order.