FlexGrid for WinForms
Sorting Multiple Columns
Show AllShow All
Hide AllHide All

To sort multiple columns, set each column's Sort property and use the Sort method to sort according to the column settings.

  1. Add the following code to the Form_Load event to set the second column to sort in ascending order and the third column to sort in descending order.

    To write code in Visual Basic

    To write code in C#

  2. Add the following Sort method to sort according to the settings in columns two and three.

    To write code in Visual Basic

    To write code in C#

This topic illustrates the following:

Your grid will look like the following with the second column sorted in ascending order, then the third column in descending order. In this example, Neon appears before Argon in the Element column since the grid is sorted first by the StandardState column in ascending order, then by the Element column in descending order.


 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback