ListviewSorter not working properly.

  • Thread starter Thread starter archana
  • Start date Start date
A

archana

Hi all,
I am facing some strange problem in listview in .net.
I have written one class for sorting of listview which i have derived
from icomparer.

Now i am adding some element to listview and then i am setting
listitemsorter property of listview to my first column.

Say support i am adding element as 13,11,14.

After applying sorter it is displaying element in ascending order like
11 13 14.

But the problem is when i try to access 1 element of first row that is
11, it is giving me element as 13 means it is consider order before
sorting.

Can someone tell me why this is happening.

Any help will be truely appreciated.
 
Hi,

archana said:
Hi all,
I am facing some strange problem in listview in .net.
I have written one class for sorting of listview which i have derived
from icomparer.

Now i am adding some element to listview and then i am setting
listitemsorter property of listview to my first column.

Say support i am adding element as 13,11,14.

After applying sorter it is displaying element in ascending order like
11 13 14.

But the problem is when i try to access 1 element of first row that is
11, it is giving me element as 13 means it is consider order before
sorting.

remember that the starting index of the Items collection is 0 , so the
second element (with index 1) is 13 , the first element (index 0 ) is 11
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top