Try this :
You can use pageindexChanging event of Grid.
in that event you can write:
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
SqlConnection con = new SqlConnection(_connString);
using (con)
{
con.Open();
DataSet ds = new DataSet();
if (DropDownList1.SelectedItem.Value == "Sort by StudentName")
{
SqlDataAdapter dad = new SqlDataAdapter("select RollNo, StudentId, StudentName, StudFatherName,DateLastChange, DateValidFrom,"
+ "DateValidTo, ReservationNo, ClassType, location from StudentData order by StudentName", con);
dad.Fill(ds, "records");
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
else if (DropDownList1.SelectedItem.Value == "Sort By Date")
{
SqlDataAdapter dad = new SqlDataAdapter("select RollNo, StudentId, StudentName, StudFatherName,DateLastChange, DateValidFrom,"
+ "DateValidTo, ReservationNo, ClassType, location from StudentData order by DateLastChange", con);
dad.Fill(ds, "records");
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
this will help you, if not please post it...