protected void GVinformation_Sorting(object sender, GridViewSortEventArgs e) { users us = new users(); string sortExpression = e.SortExpression; if (GVinformation.SortDirection == SortDirection.Ascending) { DataView dv = us.GetAllGoods_Order(us).Tables[0].DefaultView; dv.Sort = sortExpression + "DESC"; GVinformation.DataSource = dv; GVinformation.DataBind(); } else { DataView dv = us.GetAllGoods_Order(us).Tables[0].DefaultView; dv.Sort = sortExpression + "ASC"; GVinformation.DataSource = dv; GVinformation.DataBind(); } }