Change the allowSorting datagrid property to true go to Columns property, select the field what you want to sort, write onto the SortExpression the same column datafield. On datagrid sorting function protected void Grid_Sorting(object sender, GridViewSortEventArgs e) { string sql = "SELECT * FROM table WHERE conditions ORDER BY " + **e.SortExpression**; SqlDataAdapter data_Adapter = new SqlDataAdapter(sql, conexxxion); DataSet dataSet = new DataSet(); data_Adapter.Fill(dataSet); Grid.DataSource = dataSet.Tables[0].DefaultView; Grid.DataBind(); } you can do it with all datagrid columns :rose:
keep Learning and you never will be out of date...