Back to Devexpress

ASPxGridBase.ClearSort() Method

aspnet-devexpress-dot-web-dot-aspxgridbase-f1b68e8a.md

latest2.1 KB
Original Source

ASPxGridBase.ClearSort() Method

Clears the sorting applied to the grid control.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public void ClearSort()
vb
Public Sub ClearSort

Remarks

When you call the ClearSort method, the control clears the sorting and grouping applied to its data.

For more information on sorting in a particular control, refer to the following topics:

Web Forms Example

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" onCustomCallback="ASPxGridView1_CustomCallback" >
    <$--...--$>
</dx:ASPxGridView>
csharp
protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e) {
    ASPxGridView1.ClearSort();
}
vb
Protected Sub ASPxGridView1_CustomCallback(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridViewCustomCallbackEventArgs)
    ASPxGridView1.ClearSort()
End Sub

MVC Example

csharp
@Html.DevExpress().GridView(settings => {
    settings.BeforeGetCallbackResult = (sender, e) => {
        MVCxGridView grid = (MVCxGridView)sender;
        grid.ClearSort();
        //...
    };
}).Bind(Model).GetHtml()

See Also

ASPxGridBase Class

ASPxGridBase Members

DevExpress.Web Namespace