aspnet-devexpress-dot-web-dot-gridviewdatacolumn-5df76d6a.md
Sorts the column in descending order.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public void SortDescending()
Public Sub SortDescending
When you call the SortAscending() or SortDescending() method, the grid sorts the column and sets its SortOrder property to the corresponding value.
For more information on sorting in the grid, refer to the following topic: ASPxGridView - Sort Data.
<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" KeyFieldName="ProductID">
<Columns>
<dx:GridViewDataTextColumn FieldName="ProductName" VisibleIndex="0" />
<dx:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="1" />
<dx:GridViewDataTextColumn FieldName="UnitsInStock" VisibleIndex="2" />
<dx:GridViewDataCheckColumn FieldName="Discontinued" VisibleIndex="3" />
<dx:GridViewDataTextColumn FieldName="UnitsOnOrder" VisibleIndex="4" />
</Columns>
</dx:ASPxGridView>
protected void Page_Load(object sender, EventArgs e) {
var column0 = (GridViewDataColumn)grid.Columns["Discontinued"];
var column1 = (GridViewDataColumn)grid.Columns["UnitPrice"];
column0.SortDescending();
column1.SortAscending();
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim column0 = CType(grid.Columns("Discontinued"), GridViewDataColumn)
Dim column1 = CType(grid.Columns("UnitPrice"), GridViewDataColumn)
column0.SortDescending()
column1.SortAscending()
End Sub
See Also