Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. listview control problem

listview control problem

Scheduled Pinned Locked Moved Visual Basic
questioncsharphelpcss
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    venadder
    wrote on last edited by
    #1

    Hi, I ahve a listview control ( detailview with one column ). Say I have A .B and C items in the list. Say when form loads A is selected by default. Now user clicks on B. How can I know which item was selected before B got focus( or got selected ). Is there a even which is fired before click event of B would be fired? This might clarify a bit. When A is clicked , i populate a corressponding grid with some data. Now user edits this data and dosn't hit save or anything. He clicks on B, now what I want to do is before the grid loads data for B ( the code for which is on click event ), i wanna read what's int eh grid for item A and save it, but how do i know which was the last selcted itedm before user switched? Please help This is visual studio 2003, vb.net, framework 1.1 :(

    C 1 Reply Last reply
    0
    • V venadder

      Hi, I ahve a listview control ( detailview with one column ). Say I have A .B and C items in the list. Say when form loads A is selected by default. Now user clicks on B. How can I know which item was selected before B got focus( or got selected ). Is there a even which is fired before click event of B would be fired? This might clarify a bit. When A is clicked , i populate a corressponding grid with some data. Now user edits this data and dosn't hit save or anything. He clicks on B, now what I want to do is before the grid loads data for B ( the code for which is on click event ), i wanna read what's int eh grid for item A and save it, but how do i know which was the last selcted itedm before user switched? Please help This is visual studio 2003, vb.net, framework 1.1 :(

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You'd have to store this info seperately, because what comes back in viewstate is the current selection and before viewstate is loaded, there is no state at all. Christian Graus - Microsoft MVP - C++

      V 1 Reply Last reply
      0
      • C Christian Graus

        You'd have to store this info seperately, because what comes back in viewstate is the current selection and before viewstate is loaded, there is no state at all. Christian Graus - Microsoft MVP - C++

        V Offline
        V Offline
        venadder
        wrote on last edited by
        #3

        Yeah this is what am doign currently, I thought there could be soemthing better. Thank You thou.

        C 1 Reply Last reply
        0
        • V venadder

          Yeah this is what am doign currently, I thought there could be soemthing better. Thank You thou.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          OK, no worries. There isn't AFAIK any other way to do this. Christian Graus - Microsoft MVP - C++

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups