1. First, set the ALLOWSORTING property of the DataGrid control to True to make the DataGrid control can display the text of the title as a sorted link. 2, set the SortCommand event action of the DataGrid control to associate 3, by passing the value sortexpression attribute generated by clicking the sort title to the ORDER clause of the SQL statement to implement the sorting function. Example: Public Void Sort_Data (Object Src, DataGridSortCommandeventAndArgs E) {_sortexpression = E.Sortexpression; bindgrid ();} Get the _Sortexpression value in the BindGrid function, then assign a value in the Order By clause to achieve the order of order. IF (_Sortexpression! = Null) {SQLSTR = SQLSTR "Order by" _Sortexpression;}