aspnet-devexpress-dot-web-dot-aspxgridbase-dd1fcf6b.md
Gets the number of sorted columns (rows for ASPxVerticalGrid).
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public int SortCount { get; }
Public ReadOnly Property SortCount As Integer
| Type | Description |
|---|---|
| Int32 |
The number of columns (rows).
|
Grid controls allow users to sort data by multiple columns. Use the SortCount property to obtain the number of sorted columns.
For more information on the sort mode in a particular control, refer to the following topics:
The code sample below uses the SortCount property to display the number of sorted columns.
<dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server"
OnBeforeGetCallbackResult="grid_BeforeGetCallbackResult">
<ClientSideEvents EndCallback="OnEndCallback" />
<%--...--%>
</dx:ASPxGridView>
<div>
Sorted columns count: <span id="sortCount" style="font-weight: bold">0</span>
</div>
function OnEndCallback(s, e) {
document.getElementById("sortCount").innerHTML = s.cpSortCount;
}
protected void grid_BeforeGetCallbackResult(object sender, EventArgs e) {
grid.JSProperties["cpSortCount"] = grid.SortCount;
}
Protected Sub grid_BeforeGetCallbackResult(ByVal sender As Object, ByVal e As EventArgs)
grid.JSProperties("cpSortCount") = grid.SortCount
End Sub
See Also