ListviewSorter not working properly.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • archana

    ListviewSorter not working properly.

    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.

  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: ListviewSorter not working properly.

    Hi,

    "archana" <trialproduct20 04@yahoo.com> wrote in message
    news:1140006984 .256971.207160@ o13g2000cwo.goo glegroups.com.. .[color=blue]
    > 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.[/color]

    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


    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation


    Comment

    Working...