I need to use a DataTable in memory based on the column and direction that come from the GridView. The function should look like this:
public static DataTable resort(DataTable dt, string colName, string direction) { DataTable dtOut = null; .... }
I need help filling out this feature. I think I can use the Select statement, but I'm not sure how to do this. I can’t click on "Comments" because of this browser, but you can show me in place either the new DataTable solution, or one. For people showing me pointers, please, I need a coded function similar to the one that was prototyped.
What about:
// ds.Tables[0].DefaultView.Sort="au_fname DESC"; public static void Resort(ref DataTable dt, string colName, string direction) { string sortExpression = string.Format("{0} {1}", colName, direction); dt.DefaultView.Sort = sortExpression; }
Sam Gentile Feb 15 2018-11-15T00: 00Z
source share