Category / Section
How to sort the enum type column?
1 min read
By default, the enumeration column is sorted based on the enum flags. So, the display values of that column are different from the normal column sorting. When you want to sort the enumeration column based on the values displayed, you can handle it by changing the CellValueType of the column as string.
C#
//changes the CellValueType as string of Enum column this.gridGroupingControl1.TableDescriptor.Columns["Enum"].Appearance.AnyRecordFieldCell.CellValueType = typeof(string);
VB
‘changes the cell value type as string of Enum column Me.gridGroupingControl1.TableDescriptor.Columns("Enum").Appearance.AnyRecordFieldCell.CellValueType = GetType(String)
The following screenshot displays the sorting of Enum column.
Sample Links:
C#: SortEnumColumn
VB: SortEnumColumn