forum

home / developersection / forums / sorting two columns in c# using the values in one column

Sorting two columns in c# using the values in one column

Samuel Fernandes 2591 29-Mar-2014

I have two columns

form.myDataTable.Rows[i][2 * cs] = corr;               

form.myDataTable.Rows[i][2 * cs + 1] = "p" + Convert.ToString(col1) + " p" + Convert.ToString(col2);

I need to sort 2*cs column by values and also corresponding names in column 2*cs+1.

I am trying like this: var corrvalues = new Dictionary(); correlationvalues["p" + Convert.ToString(col1) + " p" + Convert.ToString(col2)] = corr; sortedvalues = correlationvalues.Values.OrderByDescending;

I am not clear how to use orderbydescending, i am new to c#. Thanks for help.


c# c# 
Updated on 29-Mar-2014
Can you answer this question?

Answer

1 Answers

Liked By