Tag Archives: sort

Align numeric values in ComboBox and ListBox controls in C#

The example Sort partly numeric items in a ComboBox or ListBox in C# displays a list of values that begin with numbers. Unfortunately the text doesn’t line up nicely in the result. This example solves that problem by using a … Continue reading

Posted in controls, fonts | Tagged , , , , , , , , , , , | Leave a comment

Sort partly numeric items in a ComboBox or ListBox in C#

The example Use a custom sort order for ListBox or ComboBox items in C# shows how to sort numeric values. This example uses the same basic approach: make an array of values, sort them as you want them displayed, and … Continue reading

Posted in algorithms, controls | Tagged , , , , , , , , , , , | 1 Comment

Sort and search arrays in C#

The Array class provides several useful methods for working with arrays. Two of them let you sort and search arrays. The following code shows how the program uses the Array class’s Sort method to sort an array of random data. … Continue reading

Posted in algorithms, arrays | Tagged , , , , , , , , , , , | 1 Comment

Sort a ListView using the column you click in C#

You can sort a ListView using the column you click, but it’s a lot more work than simply sorting the ListView‘s items. To sort using the items, you can simply set the control’s Sorting property to Ascending or Descending. Unfortunately, … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | 12 Comments

Sort a ListView control using all of its columns in C#

You can make the ListView sort by setting its Sorting property to Ascending or Descending, but it takes some extra work to sort a ListView control using all of its columns. Normally the control only sorts on its items, not … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | Leave a comment