DataTable sorting with Datacolumn Name with comma
I have data table showing statistics of different cities for different periods. It has following columns names Period | city1,state | city2,state | city3,state Jan 15 25 20 Feb 5 26 29 Mar 35 27 21 I have applied some logic and it gives me column name to sort the respective column name and bind the data again with grid on front End. Now problems comes when I tried the following code for sorting griData.DefaultView.Sort = string.Format("{0} {1}", orderByField, sortDirection) Because of the comma in the column name it treats it as two columns and give exception. Example: If I am sorting by