DataView dv = dt.DefaultView;//Your datatable, dt. dv.RowFilter = "";//Set row filter to none. if ((strSortBy != null) && (strSortAscending != null)) dv.Sort = strSortBy/*Column name*/ + " " + strSortAscending /*ASC, for instance.*/; grd.DataSource = dv; grd.DataBind();
Happy sorting!