asp.net.ph

DataView.Sort Property

System.Data Namespace   DataView Class


Sets or retrieves the sorting order for data in a table.

Syntax


Script DataView.Sort [ = strExpression ]

Property Value


strExpression A string containing the column name followed by ASC ( ascending ) or DESC ( descening ).

The property is read/write with no default value.

Remarks

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.

Example

The following examples demonstrate using the Sort property to set the order of records in a DataView. In the first two, the sort order is set at design time, while in the last, the sort order is dynamically set at run time, based on user input.

Filtering a DataView
Run Sample | View Source
Paging thru RowFilter Results
Run Sample | View Source
DataGrid AllowSorting Property
Run Sample | View Source

See Also

DataView Members   RowFilter   Expression Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph