Sorting a flattened array
You can improve the code for 3 or more columns and at the same time use it for 1 or 2 columns, by using LINQ:

public partial class FlattenedArray
{
    public int rows;
    public int cols;
    public double[] array;
    public void sort()
    {
        array = (from i in Enumerable.Range(0, rows)
                        select new List&lt;double&gt;(array.ToList().GetRange(cols * i, cols)))
                        .OrderBy(x =&gt; x[0])
                        .SelectMany(x =&gt; x)
                        .ToArray();     
    }
}


This divides the array into dimensions and sorts it by the first column then flattens it all back to 1D.  It will work for any combination of rows and columns as long the conditions you mentioned hold true.

If the data size gets very large you still might want to use Array.Sort for the 1 column data as this code wouldn't be very efficient for 1 column.