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 / C++ / MFC
  4. How to hide column in list control

How to hide column in list control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
11 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.
  • S Offline
    S Offline
    sheshidar
    wrote on last edited by
    #1

    Hi all. how can we hide a column in list view. I have to maintain the data in column but that perticular column should not visible to end user.how can i do this..

    CPalliniC D H 3 Replies Last reply
    0
    • S sheshidar

      Hi all. how can we hide a column in list view. I have to maintain the data in column but that perticular column should not visible to end user.how can i do this..

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      Technically you cannot hide a column, however you can set its width equal to zero, obtaining the same effect (albeit the user can change it). :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      N 1 Reply Last reply
      0
      • CPalliniC CPallini

        Technically you cannot hide a column, however you can set its width equal to zero, obtaining the same effect (albeit the user can change it). :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        CPallini wrote:

        however you can set its width equal to zero,

        Pressing 'Ctrl + +' redisplays it. It's the shortcut for auto resizing list control columns, based on it's contents, in windows.


        Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

        CPalliniC 1 Reply Last reply
        0
        • N Nibu babu thomas

          CPallini wrote:

          however you can set its width equal to zero,

          Pressing 'Ctrl + +' redisplays it. It's the shortcut for auto resizing list control columns, based on it's contents, in windows.


          Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          I know. If you need to handle this then a more elaborate approach involves overriding DrawItem. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          In testa che avete, signor di Ceprano?

          N 1 Reply Last reply
          0
          • CPalliniC CPallini

            I know. If you need to handle this then a more elaborate approach involves overriding DrawItem. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

            N Offline
            N Offline
            Nibu babu thomas
            wrote on last edited by
            #5

            CPallini wrote:

            If you need to handle this then a more elaborate approach involves overriding DrawItem.

            One way could be to create a virtual list control and just don't give any text to hidden columns(this includes the header for the column), this way windows won't show this column I guess, even when this shortcut is pressed. :~


            Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

            CPalliniC 1 Reply Last reply
            0
            • N Nibu babu thomas

              CPallini wrote:

              If you need to handle this then a more elaborate approach involves overriding DrawItem.

              One way could be to create a virtual list control and just don't give any text to hidden columns(this includes the header for the column), this way windows won't show this column I guess, even when this shortcut is pressed. :~


              Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              This implies you have to copy data elsewhere. Once you copied data you may just delete the column. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

              In testa che avete, signor di Ceprano?

              N 1 Reply Last reply
              0
              • CPalliniC CPallini

                This implies you have to copy data elsewhere. Once you copied data you may just delete the column. :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                N Offline
                N Offline
                Nibu babu thomas
                wrote on last edited by
                #7

                CPallini wrote:

                This implies you have to copy data elsewhere. Once you copied data you may just delete the column.

                Yeah that is what I meant by virtual list.


                Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

                1 Reply Last reply
                0
                • S sheshidar

                  Hi all. how can we hide a column in list view. I have to maintain the data in column but that perticular column should not visible to end user.how can i do this..

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  sheshidar wrote:

                  ...that perticular column should not visible to end user.

                  Then why bother having it?


                  "A good athlete is the result of a good and worthy opponent." - David Crow

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  S 1 Reply Last reply
                  0
                  • D David Crow

                    sheshidar wrote:

                    ...that perticular column should not visible to end user.

                    Then why bother having it?


                    "A good athlete is the result of a good and worthy opponent." - David Crow

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    S Offline
                    S Offline
                    sheshidar
                    wrote on last edited by
                    #9

                    I have to keep the data in the column, but only thing is end user should not know that there is the column i list.

                    D 1 Reply Last reply
                    0
                    • S sheshidar

                      I have to keep the data in the column, but only thing is end user should not know that there is the column i list.

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #10

                      sheshidar wrote:

                      I have to keep the data in the column,

                      But why? There may be another, more elegant, solution.


                      "A good athlete is the result of a good and worthy opponent." - David Crow

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      1 Reply Last reply
                      0
                      • S sheshidar

                        Hi all. how can we hide a column in list view. I have to maintain the data in column but that perticular column should not visible to end user.how can i do this..

                        H Offline
                        H Offline
                        Hamid Taebi
                        wrote on last edited by
                        #11

                        See An effective way to hide or show columns in list control dynamically[^]


                        WhiteSky


                        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