问题
I have a DataTable. I'd like to sort its default view by a column name 'city'. I'd like the sort to be case-insensitive.
Here is the code I have:
DataTable dt = GetDataFromSource();
dt.DefaultView.Sort = "city asc";
MyReport.DataSource = dt.DefaultView;
Thanks.
回答1:
Never mind. It's in the documentation.
DataTable dt = GetDataFromSource();
dt.CaseSensitive = false;
dt.DefaultView.Sort = "city asc";
来源:https://stackoverflow.com/questions/521795/how-to-sort-a-dataview-in-a-case-insensitive-manner