Results 1 to 3 of 3

Thread: [2005] Listview question

  1. #1

    Thread Starter
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    [2005] Listview question

    hi folks, i've got an issue at the moment with a listview and was wondering if anyone can help:


    I have two listviews. You select a row in listview 1 (multi-select = False; FullRowSelect = True), and that acts as a filter for the contents which are then shown in listview 2 which is below it. That works fine. However, the row that was selected in listview 1 then becomes unselected when you select a row in listview 2 (with the row in listview2 becoming selected). I want to show both selections so it's easy to see which row in listview1 caused the particular filter in listview 2. I've tried grouping them into different panels etc... but it doesn't work. Anyone got a solution?

    Any ideas/solutions would be most welcome.
    Last edited by stimbo; Dec 19th, 2007 at 06:22 PM.
    Stim

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

  2. #2
    Fanatic Member Jumpercables's Avatar
    Join Date
    Jul 2005
    Location
    Colorado
    Posts
    592

    Re: [2005] Listview question

    What if you use the Selected property on the ListViewItem?

    C# - .NET 1.1 / .NET 2.0

    "Take everything I say with a grain of salt, sometimes I'm right, sometimes I'm wrong but in the end we've both learned something."
    _____________________
    Regular Expressions Library
    Connection String
    API Functions
    Database FAQ & Tutorial

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Listview question

    The row in the first control doesn't become unselected. It just becomes unhighlighted. Set the HideSelection property to False and the selection will remain highlighted even when the control is not active.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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