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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. User edit of a CListCtrl SubItem

User edit of a CListCtrl SubItem

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
8 Posts 5 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.
  • B Offline
    B Offline
    b_girl
    wrote on last edited by
    #1

    I have a CListCtrl (report view) with 2 columns. Once the list is populated with items, I want the user to be able to edit the information found in the second column. I have it set up so that they can only select one row at a time. Is there some style or state that I can set which will allow a user to do this? (I know it's possible to allow editing of the information in the 1st column, but I havn't yet been able to figure out how to allow editing of the 2nd column, but NOT the 1st column).

    V H 2 Replies Last reply
    0
    • B b_girl

      I have a CListCtrl (report view) with 2 columns. Once the list is populated with items, I want the user to be able to edit the information found in the second column. I have it set up so that they can only select one row at a time. Is there some style or state that I can set which will allow a user to do this? (I know it's possible to allow editing of the information in the 1st column, but I havn't yet been able to figure out how to allow editing of the 2nd column, but NOT the 1st column).

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      One solution is SetItemText(). Pass in the row and column. Kuphryn

      B 1 Reply Last reply
      0
      • V valikac

        One solution is SetItemText(). Pass in the row and column. Kuphryn

        B Offline
        B Offline
        b_girl
        wrote on last edited by
        #3

        That's not exactly what I want. I'd like the user to be able to edit it in place. Like, when they click on it, I want them to be able to edit the contents of that specific item (in the second column) without anything else popping up. I'm assuming that by using SetItemText() I'd have to have a separate place (an edit box) for the user to enter this information, then get the text from that edit box and update the list control with the new text. Ideally, I'd like to be able to just do it from within the list control.

        A V B 3 Replies Last reply
        0
        • B b_girl

          That's not exactly what I want. I'd like the user to be able to edit it in place. Like, when they click on it, I want them to be able to edit the contents of that specific item (in the second column) without anything else popping up. I'm assuming that by using SetItemText() I'd have to have a separate place (an edit box) for the user to enter this information, then get the text from that edit box and update the list control with the new text. Ideally, I'd like to be able to just do it from within the list control.

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          I'm afraid it's not possible using just CListCtrl. You need something more customizable. Check out the classes available here[^] on CP. Regards, Alvaro


          Can I ask you a question?

          B 1 Reply Last reply
          0
          • B b_girl

            That's not exactly what I want. I'd like the user to be able to edit it in place. Like, when they click on it, I want them to be able to edit the contents of that specific item (in the second column) without anything else popping up. I'm assuming that by using SetItemText() I'd have to have a separate place (an edit box) for the user to enter this information, then get the text from that edit box and update the list control with the new text. Ideally, I'd like to be able to just do it from within the list control.

            V Offline
            V Offline
            vcplusplus
            wrote on last edited by
            #5

            Check out these web sites or search for LVN_ENDLABELEDIT on google. http://www.markhilgart.com/code/subedit http://www.codeguru.com/listview/drop_down_list.shtml

            1 Reply Last reply
            0
            • B b_girl

              That's not exactly what I want. I'd like the user to be able to edit it in place. Like, when they click on it, I want them to be able to edit the contents of that specific item (in the second column) without anything else popping up. I'm assuming that by using SetItemText() I'd have to have a separate place (an edit box) for the user to enter this information, then get the text from that edit box and update the list control with the new text. Ideally, I'd like to be able to just do it from within the list control.

              B Offline
              B Offline
              b_girl
              wrote on last edited by
              #6

              Thanks. I think I found what I'm looking for now...

              1 Reply Last reply
              0
              • A Alvaro Mendez

                I'm afraid it's not possible using just CListCtrl. You need something more customizable. Check out the classes available here[^] on CP. Regards, Alvaro


                Can I ask you a question?

                B Offline
                B Offline
                b_girl
                wrote on last edited by
                #7

                I read through the article that does this at: http://www.codeproject.com/listctrl/listeditor.asp which led me to read an article on CodeGuru.com relating to the same thing. http://www.codeguru.com/listview/edit_subitems.shtml I have a bit of a problem. I have a class (CElementListCtrl, derived from CListCtrl) which contains all of the functions found in the above link. In my CTraceElementDialog class I have a member variable of type CElementListCtrl: CElementListCtrl m_elementList; The list gets created as it should, but none of the code in the functions contained within CElementListCtrl ever get executed. In the article I used as a reference, it mentioned using the WM_LBUTTONDOWN message, but I can't seem to be able to use that message for my list. The only message available that is close to being the same (I think?) is the NM_CLICK message. I have tried to use a message map for this, but it still doesn't work at all. I have no clue what I'm doing wrong.

                1 Reply Last reply
                0
                • B b_girl

                  I have a CListCtrl (report view) with 2 columns. Once the list is populated with items, I want the user to be able to edit the information found in the second column. I have it set up so that they can only select one row at a time. Is there some style or state that I can set which will allow a user to do this? (I know it's possible to allow editing of the information in the 1st column, but I havn't yet been able to figure out how to allow editing of the 2nd column, but NOT the 1st column).

                  H Offline
                  H Offline
                  happykimzeng
                  wrote on last edited by
                  #8

                  use CListCtrl::SetExtendedStyle(LVS_EX_LABELTIP ), LVS_EX_LABELTIP Version 5.80. If a partially hidden label in any list-view mode lacks ToolTip text, the list-view control will unfold the label. If this style is not set, the list-view control will unfold partly hidden labels only for the large icon mode.

                  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