In the end I managed to do it like this.
A "datagroup" is a group of rows which have the same values in column(D) DATE, grouped by days. "type" is not really relevant, it is just because in my DataSet.Table's I have a column in which there are two possible values, and according to the value in the row, the row will be written in either the first or the second worksheet in the workbook.
The "Incasari" is the column which I use to sort by. Like this, symbols, numbers, lower case letters, uppercase letters, then blank spaces or empty strings come; and that column has only symbols, numbers, lower case letters and blank spaces/ empty strings.
var sortedDataGroup = datagroup.OrderBy(row =>
var wrapper = new DataRowWrapper(row, type);
if (wrapper.Incasari != null)
return "A"; });
It might not be the best way to solve this sorting problem, but I could not find better methods.