Skip to main content
All docs
V24.2

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

ImageListBoxControl.CustomSort Event

Enables you to sort list items in custom order.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Behavior")]
public event EventHandler<ImageListBoxCustomSortEventArgs> CustomSort

#Event Data

The CustomSort event's data class is DevExpress.XtraEditors.Controls.ImageListBoxCustomSortEventArgs.

#Remarks

Handle the CustomSort event to compare two neighboring items (e.Item1 and e.Item2). You can compare items by their values (e.Value1, e.Value2) or display text (e.DisplayText1, e.DisplayText2). Set the e.Result parameter to 1 to position the first item above the second item, or set it to -1 to position the second item above the first item.

For optimization purposes, the editor itself does not raise the CustomSort event. Use the Sort() method to raise the CustomSort event when needed.

Note

  1. Custom sorting does not work in bound mode.
  2. The SortOrder property is ignored when you handle the CustomSort event.
See Also