[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Collapse]Windows 10 App Controls
  Prerequisites
 [Expand]Getting Started
 [Expand]Controls
 [Expand]Themes and Color Schemes
  Localization
  Get More Help
 [Collapse]API Reference
  [Expand]DevExpress.Core
  [Expand]DevExpress.Data
  [Expand]DevExpress.Data.Filtering
  [Expand]DevExpress.Mvvm
  [Expand]DevExpress.Mvvm.UI
  [Expand]DevExpress.UI.Xaml
  [Expand]DevExpress.UI.Xaml.Charts
  [Expand]DevExpress.UI.Xaml.Controls
  [Expand]DevExpress.UI.Xaml.Controls.Internal.Pdf
  [Expand]DevExpress.UI.Xaml.Editors
  [Expand]DevExpress.UI.Xaml.Editors.Native
  [Expand]DevExpress.UI.Xaml.Gauges
  [Collapse]DevExpress.UI.Xaml.Grid
   [Expand]AddingNewEventArgs Class
    AutoFilterCondition Enumeration
   [Expand]ColumnBase Class
   [Expand]ColumnCollection Class
    ColumnFilterMode Enumeration
   [Expand]CustomColumnSortEventArgs Class
    CustomColumnSortEventHandler Delegate
   [Collapse]DataControlBase Class
     DataControlBase Members
    [Expand]DataControlBase Properties
    [Expand]DataControlBase Events
    [Collapse]DataControlBase Methods
      BeginDataUpdate Method
      BeginInit Method
      BeginSelection Method
     [Expand]ClearColumnFilter Method
      ClearSorting Method
      CollapseAllGroups Method
      CommitEditing Method
      EndDataUpdate Method
      EndInit Method
      EndSelection Method
      ExpandAllGroups Method
      GetCellElementByRowHandleAndColumn Method
      GetCellElementByTreeElement Method
      GetCellValue Method
      GetColumnByTreeElement Method
     [Expand]GetColumnFilterCriteria Method
     [Expand]GetColumnFilterString Method
      GetCurrentGrid Method
      GetCurrentViewChangedListener Method
      GetRowElementByRowHandle Method
      GetRowState Method
      GetSelectedCells Method
      GetTotalSummaryValue Method
      HideEditor Method
      IsCellSelected Method
      IsItemSelected Method
     [Expand]MergeColumnFilters Method
      MoveColumnTo Method
      MoveFirstRow Method
      MoveLastRow Method
      MoveNextPage Method
      MoveNextRow Method
      MovePrevPage Method
      MovePrevRow Method
      MoveSelectedItem Method
      PopulateColumns Method
      PostEditor Method
      RefreshData Method
     [Expand]ScrollIntoView Method
      SelectAll Method
      SelectCell Method
      SelectCells Method
     [Expand]SelectItem Method
      SelectRange Method
      SetCurrentGrid Method
      SetCurrentViewChangedListener Method
      ShowEditor Method
      SortBy Method
      UnselectAll Method
      UnselectCell Method
      UnselectCells Method
     [Expand]UnselectItem Method
      UpdateTotalSummary Method
      UpdateUnboundColumnValues Method
    ExceptionMode Enumeration
    FilterPopupMode Enumeration
    FindMode Enumeration
   [Expand]GridCell Class
   [Expand]GridCheckBoxColumn Class
   [Expand]GridColumnBase Class
   [Expand]GridColumnCollection Class
   [Expand]GridColumnCommands Class
   [Expand]GridColumnDataEventArgs Class
    GridColumnDataEventHandler Delegate
   [Expand]GridComboBoxColumn Class
   [Expand]GridControl Class
   [Expand]GridControlBase Class
   [Expand]GridControlCommands Class
    GridControlNavigationStyle Enumeration
   [Expand]GridDateColumn Class
   [Expand]GridMaskColumn Class
   [Expand]GridSpinEditColumn Class
    GridSummaryItemAlignment Enumeration
   [Expand]GridTemplateColumn Class
   [Expand]GridTextColumn Class
   [Expand]GridTextColumnBase Class
   [Expand]GridTotalSummaryData Class
    GroupSummaryDisplayMode Enumeration
   [Expand]HighlightingSettings Class
   [Expand]InitNewRowEventArgs Class
   [Expand]InvalidRowExceptionEventArgs Class
    MultiSelectMode Enumeration
    NewItemRowPosition Enumeration
   [Expand]RowEventArgs Class
    RowEventHandler Delegate
    ScrollAnimationMode Enumeration
    ShowFilterPanelMode Enumeration
    ShowSearchPanelMode Enumeration
   [Expand]SummaryItemBase Class
  [Expand]DevExpress.UI.Xaml.Grid.Native
  [Expand]DevExpress.UI.Xaml.Layout
  [Expand]DevExpress.UI.Xaml.Layout.Base
  [Expand]DevExpress.UI.Xaml.Layout.Internal
  [Expand]DevExpress.UI.Xaml.Layout.VisualElements
  [Expand]DevExpress.UI.Xaml.Map
  [Expand]DevExpress.UI.Xaml.Ribbon
  [Expand]DevExpress.Utils
  [Expand]DevExpress.XtraGrid
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

DataControlBase.SortBy Method

Sorts data by the values of the specified column.

Namespace:DevExpress.UI.Xaml.Grid
Assembly:DevExpress.UI.Xaml.Grid.v18.1.dll

Expanded Syntax

Parameters

fieldName
Type: String
A System.String value that specifies the column's field name.

Expanded Remarks

The Grid Control allows data sorting by multiple columns. Any previous sorting is not cleared when calling the SortBy method.

If the grid's data isn't sorted by the specified column, the SortBy method sorts data by its values in ascending order. The new sort order applies an additional sorting condition to the one previously applied.

End-users are allowed to sort data if the grid's AllowSorting property is set to true.

Expanded See Also

Is this topic helpful?​​​​​​​