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. C#
  4. Listview rubberbanding issue

Listview rubberbanding issue

Scheduled Pinned Locked Moved C#
helpquestion
2 Posts 1 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.
  • G Offline
    G Offline
    Gavin Roberts
    wrote on last edited by
    #1

    Hi all, It seems an application i'm working on has developed a problem. My colleague has created a user control which inherits the ListView control so we can implement an edit in place feature. The edit in place feature simply listens for an event when you click on a rows subitem and if its the cell you want to edit, it will move and resize a textbox over the cell and pull the value. An event (endediting) is fired when the control looses focus or a certain key is pressed. We use this event do what we want with the value typed in. This seems to work fine unless you stick in something that causes the listview to loose focus whilst within this event. I am attempting to parse the value typed in and if its invalid, I am throwing an error (messagebox) to notifiy the user and setting the cancel flag (e.Cancel.) If I use the mouse to click the OK button within the MessageBox, when it disappears an Rubberband appears on my cursor and remains inside the listview. The only way to remove this is to either click the mouse, alt+tab to cause the form to invalidate or press escape. If I use the enter or escape key to clear the MessageBox, the above doesn't happen and the listview regains focus. I'm now at a loss, I have no idea where to turn :(( I have tried invalidating the form, the listview etc, i've tried forcing the focus of all of the controls within the same form and i've even tried sending the escape key to the app using sendkeys. Has anyone got any idea's why? I'd appreciate your input! Regards

    G 1 Reply Last reply
    0
    • G Gavin Roberts

      Hi all, It seems an application i'm working on has developed a problem. My colleague has created a user control which inherits the ListView control so we can implement an edit in place feature. The edit in place feature simply listens for an event when you click on a rows subitem and if its the cell you want to edit, it will move and resize a textbox over the cell and pull the value. An event (endediting) is fired when the control looses focus or a certain key is pressed. We use this event do what we want with the value typed in. This seems to work fine unless you stick in something that causes the listview to loose focus whilst within this event. I am attempting to parse the value typed in and if its invalid, I am throwing an error (messagebox) to notifiy the user and setting the cancel flag (e.Cancel.) If I use the mouse to click the OK button within the MessageBox, when it disappears an Rubberband appears on my cursor and remains inside the listview. The only way to remove this is to either click the mouse, alt+tab to cause the form to invalidate or press escape. If I use the enter or escape key to clear the MessageBox, the above doesn't happen and the listview regains focus. I'm now at a loss, I have no idea where to turn :(( I have tried invalidating the form, the listview etc, i've tried forcing the focus of all of the controls within the same form and i've even tried sending the escape key to the app using sendkeys. Has anyone got any idea's why? I'd appreciate your input! Regards

      G Offline
      G Offline
      Gavin Roberts
      wrote on last edited by
      #2

      Well i've resolved it. By setting the following properties, it no longer causes the undesired effect. FullRowSelect = true; HeaderStyle = NonClickable; HideSelection = false; MultiSelect = false;

      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