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!

DataGrid.AllowSorting

Gets or sets a value indicating whether the grid can be resorted by clicking on a column header.

[Visual Basic]
Public Property AllowSorting As Boolean
[C#]
public bool AllowSorting {get; set;}
[C++]
public: __property bool get_AllowSorting();
public: __property void set_AllowSorting(bool);
[JScript]
public function get AllowSorting() : Boolean;
public function set AllowSorting(Boolean);

Property Value

true if columns can be resorted by clicking a column header; otherwise, false.

Remarks

You can also sort using an expression for a DataColumn. See Expression for details on creating a sort expression.

Example [Visual Basic]

The following example toggles the AllowSorting property.

[Visual Basic]

Private Sub AllowSorting()
   ' Toggle the AllowSorting property.
   DataGrid1.AllowSorting = DataGrid1.AllowSorting Xor True
End Sub

See Also

DataGrid Class | DataGrid Members | System.WinForms Namespace | Expression | Sort | Sort