Results 1 to 6 of 6

Thread: ListView & ICompare interface

  1. #1

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168

    ListView & ICompare interface

    Hi to all,

    How to sort ListView columns based on particular column (Windows Explorer style) in VB.net

    I come to know from Help that in "ColumnClick" event of I have to write following code:

    VB Code:
    1. Private Sub ListView1_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles lvwItem.ColumnClick
    2.         Me.ListView1.ListViewItemSorter= ?
    3.         Me..ListView1.Sort()
    4.     End Sub

    ?= a class instance having ICompare interface

    But I dont understanding how to do it

    Please help

    Thanks
    Last edited by parminder; Oct 9th, 2003 at 02:21 PM.

  2. #2

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168
    Please read the code as "

    VB Code:
    1. Private Sub ListView1_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles listView1.ColumnClick
    2.         Me.ListView1.ListViewItemSorter= ?
    3.         Me..ListView1.Sort()
    4.     End Sub

  3. #3

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168


    Not any Guru has seen ?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    What is it that you don't know how to do? Implement IComparer? Or you don't know what implements it already? I've seen examples posted on the forums before of sorting a Listview you may want to try searhcing.

  5. #5
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Yes it been done before. I did an example on how to do it a while back. Search the forum and you will find it.

  6. #6

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168
    Thanks Edneeis and DevGrp

    I found a example at the forume. I will try it. If some problem occurs I will ask you.

    Thans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width