NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataView.Sort

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);

Property Value

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.

Remarks

See the Expression property of DataColumn for more details on forming a Sort expression.

Example [Visual Basic]

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

See Also

DataView Class | DataView Members | System.Data Namespace | RowFilter | Expression