Gets or sets the sort column or columns, and sort order for the table.
[Visual Basic] Public Property Sort As String [C#] public string Sort {get; set;} [C++] public: __property String* get_Sort(); public: __property void set_Sort(String*); [JScript] public function get Sort() : String; public function set Sort(String);
A string containing the column name followed by "ASC" (ascending) or "DESC" (descening). Columns are sorted asending by default. Multiple columns can be separated by commas.
See the Expression property of DataColumn for more details on forming a Sort expression.
The following example instructs the DataView to sort the table by two columns.
[Visual Basic]
Private Sub SortByTwoColumns() ' Get the DefaultView of a DataSet. Dim myDataView As DataView myDataView = DataSet1.DefaultView ' By default, the first column sorted ascending. myDataView.Sort = "State, ZipCode DESC" End Sub
DataView Class | DataView Members | System.Data Namespace | RowFilter | Expression