Avatar of cstephen100
 asked on

Listview sorting issue

   I have got a form, that displays a list of categories, These categorise are sorted by a priority number, I have a two buttons up and down so, when I click on category from listview, by pressing ip/down I can move them up list and adjust priority.  The issue I am having is explained below:

I am populating a listview using an SqlDataReader. When loading the information from the database I am using a sort by ‘column’ in the SQL statement. (The column being an integer column).  However when the information gets loaded into the listview the information is not displayed the way I would wish.

The best way of describing it is using the following example of results….

Actual Output                Output Desired
1                                  1
10                                 2
11                                 3
12                                 4
2                                  5
3                                  6
4                                  7
5                                  8
6                                  9
7                                  10
8                                  11
9                                  12

Any help to get the output looking like the second column would be greatly appreciated,
The statement works fin when i run it using sql server or other windows controll i.e datagrid.

Hope someone can help,

Visual Basic.NET

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck