Here i will code you how to sort the data in the Gridview to Ascending and Descending order, To use this functionality you should enable Allow Sorting to true in Gridview Properties. OnSorting event will be used to sort the data Accordingly.Sorting can be used for Numeric values,Alphabetical values also even for dates.

Aspx code : 

<head runat="server">
 <title>Coloum value sorting in Gridview</title>
    <form id="form1" runat="server">
        <asp:GridView ID="grd_popup_details" HeaderStyle-BackColor="#cccccc" runat="server" AllowSorting="true" OnSorting="SortingEvent">

C# Code : 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace TTip
    public partial class ttcss : System.Web.UI.Page
        DataSet DS = new DataSet();
        protected void Page_Load(object sender, EventArgs e)
            SqlConnection con = new SqlConnection("connection string");
            string Query = "select Query";
            SqlDataAdapter da = new SqlDataAdapter(Query, con);
            grd_popup_details.DataSource = DS;

        protected void SortingEvent(object sender, GridViewSortEventArgs e)
            string sortDirection = "ASC";
            DataView dataView = new DataView(DS.Tables[0]);
            DataSet Ds_Sort = new DataSet();
            if (ViewState["sortkeyGV1"] != null)
                if (ViewState["sortkeyGV1"].ToString() == e.SortExpression)
                    sortDirection = "DESC";
            dataView.Sort = e.SortExpression + " " + sortDirection;

            grd_popup_details.DataSource = Ds_Sort;
            ViewState["sortkeyGV1"] = e.SortExpression;