HI
I USE THIS below code for sorting but, when we are click sorting columns , then it will showing the next page rows also, i need only this rows only sorting
waiting for ur reply
bye
private void Sort_DataGrid(object source,
System.Web.UI.WebControls.DataGridSortCommandEvent Args e)
{
SqlCommand myCommand =
new SqlCommand("SELECT * FROM Categories",myConnection);
myCommand.CommandType = CommandType.Text;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds,"Categories");
DataView dv = new DataView(ds.Tables["Categories"]);
// Two way sorting LOGIC
if( (numberDiv%2) == 0 )
dv.Sort = e.SortExpression + " " + "ASC";
else
dv.Sort = e.SortExpression + " " + "DESC";
numberDiv++;
myDataGrid.DataSource = dv;
myDataGrid.DataBind();
}