Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Sort Data Against Two or More Columns

The following example sorts data by two columns in a Grid View. The code is enclosed within calls to the ColumnView.BeginDataUpdate and BaseView.EndDataUpdate methods. This speeds up performance by sorting the data only once, after the BaseView.EndDataUpdate method is called.

    gridView1.BeginDataUpdate();
    try {
        gridView1.ClearSorting();
        gridView1.Columns["Trademark"].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
        gridView1.Columns["Model"].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
    }
    finally {
        gridView1.EndDataUpdate();
    }