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. ObjectListView cell contents changing Issue

ObjectListView cell contents changing Issue

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 3 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.
  • P Offline
    P Offline
    Pasan148
    wrote on last edited by
    #1

    I wanted to pragmatically change the content of a cell. So I have tried something like this

    Private Structure Items
    Dim ID as Integer
    Dim Name as String
    End Structure

    Dim objItem as Items
    Private Sub AddItem()
    objItem.ID = 1
    objItem.Name = "Name"
    objectlistview.AddObject(objItem)
    End Sub

    Private sub ChangeItem()
    objItem.Name = "MyName"
    objectlistview.RefreshObject(objItem)
    End Sum

    AddItem() method is working fine. But ChangeItem() method doesn't work. What's wrong with code

    T B 2 Replies Last reply
    0
    • P Pasan148

      I wanted to pragmatically change the content of a cell. So I have tried something like this

      Private Structure Items
      Dim ID as Integer
      Dim Name as String
      End Structure

      Dim objItem as Items
      Private Sub AddItem()
      objItem.ID = 1
      objItem.Name = "Name"
      objectlistview.AddObject(objItem)
      End Sub

      Private sub ChangeItem()
      objItem.Name = "MyName"
      objectlistview.RefreshObject(objItem)
      End Sum

      AddItem() method is working fine. But ChangeItem() method doesn't work. What's wrong with code

      T Offline
      T Offline
      TnTinMn
      wrote on last edited by
      #2

      If you are referring to the control presented in this article[^], I suggest that you ask the author in the comments section[^].

      1 Reply Last reply
      0
      • P Pasan148

        I wanted to pragmatically change the content of a cell. So I have tried something like this

        Private Structure Items
        Dim ID as Integer
        Dim Name as String
        End Structure

        Dim objItem as Items
        Private Sub AddItem()
        objItem.ID = 1
        objItem.Name = "Name"
        objectlistview.AddObject(objItem)
        End Sub

        Private sub ChangeItem()
        objItem.Name = "MyName"
        objectlistview.RefreshObject(objItem)
        End Sum

        AddItem() method is working fine. But ChangeItem() method doesn't work. What's wrong with code

        B Offline
        B Offline
        Bernhard Hiller
        wrote on last edited by
        #3

        Do not use such a confusing naming of your variables! When I read Item**s**, I expect some kind of a collection/array. And better use a Class instead of a Structure. In your ChangeItem function, you must retrieve the item from the listview, and then change its properties.

        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