Home > Back-end >  GridView Column sort in descending
GridView Column sort in descending

Time:02-06

welcome all I have a simple code that displays the values in a GridView When sorting, the result is ascending I want the opposite

enter image description here

I used this code But I want to reverse the order

GridView1.DataSource = dt;
dt.DefaultView.Sort = "MYPoints";
GridView1.DataSource = dt.DefaultView;
GridView1.DataBind(); 

Thanks for help

CodePudding user response:

this should work:

dt.DefaultView.Sort = "MYPoints DESC";
  • Related