Results 1 to 4 of 4

Thread: [2005] how to sort a list view

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2007
    Posts
    44

    [2005] how to sort a list view

    hi
    I've a listview with filenames loaded from a database.
    after I load the file names to the listview I want to sort the listview first by TYPE and afterwards by filename.

    how can it be done

    thanks

  2. #2
    Fanatic Member Clanguage's Avatar
    Join Date
    Jan 2008
    Location
    North Carolina
    Posts
    659

    Re: [2005] how to sort a list view

    Hi Yossilb
    I think that it would be a lot easier to do an Order By when querying the data than through code.
    CLanguage;
    IF Post = HelpFull Then
    RateMe
    Else
    Say("Shut UP")
    End If
    DotNet rocks
    VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?

  3. #3
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] how to sort a list view

    you would have to implement your own sorting mechanism. Here's an example but it's single column only as far as i know. U would have to adapt it to sort by multiple columns.

    Sort Listview
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] how to sort a list view

    Quote Originally Posted by Clanguage
    Hi Yossilb
    I think that it would be a lot easier to do an Order By when querying the data than through code.
    I agree with Clanguage. Sort the unlaying data before loading the ListView.

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