Link to home
Start Free TrialLog in
Avatar of cstephen100
cstephen100

asked on

Listview sorting issue

Hi
   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,
Regards
Stephen


ASKER CERTIFIED SOLUTION
Avatar of gladiatorno9
gladiatorno9

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial