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. Hiding columns in a data grid view

Hiding columns in a data grid view

Scheduled Pinned Locked Moved C#
helpcss
8 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.
  • J Offline
    J Offline
    jasper018
    wrote on last edited by
    #1

    Hello, Any help would be great! I have tryed the (datagrid.columns[1]. visable = false) the issue is that, using this method shrinks all the rows of data in the data grid view. Even if i set the row height, it seems to make no difference. I need to set which columns are shown in code, and I change the data source for the data grid view as needed. any help would be great. thanks, J

    X R 2 Replies Last reply
    0
    • J jasper018

      Hello, Any help would be great! I have tryed the (datagrid.columns[1]. visable = false) the issue is that, using this method shrinks all the rows of data in the data grid view. Even if i set the row height, it seems to make no difference. I need to set which columns are shown in code, and I change the data source for the data grid view as needed. any help would be great. thanks, J

      X Offline
      X Offline
      Xmen Real
      wrote on last edited by
      #2

      try this

      DGV.Columns[1].Width = 0;

      TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can

      J 1 Reply Last reply
      0
      • J jasper018

        Hello, Any help would be great! I have tryed the (datagrid.columns[1]. visable = false) the issue is that, using this method shrinks all the rows of data in the data grid view. Even if i set the row height, it seems to make no difference. I need to set which columns are shown in code, and I change the data source for the data grid view as needed. any help would be great. thanks, J

        R Offline
        R Offline
        Ravenet
        wrote on last edited by
        #3

        Hi very easy set colum width is zero. thanks

        Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

        J 1 Reply Last reply
        0
        • R Ravenet

          Hi very easy set colum width is zero. thanks

          Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

          J Offline
          J Offline
          jasper018
          wrote on last edited by
          #4

          Thank you for the help, but that does not work. You can see all the columns with a width of 0, they appear as just lines... but thanks.

          R 1 Reply Last reply
          0
          • X Xmen Real

            try this

            DGV.Columns[1].Width = 0;

            TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can

            J Offline
            J Offline
            jasper018
            wrote on last edited by
            #5

            Thank you for the help, but that does not work. You can see all the columns with a width of 0, they appear as just lines... you can still expand the columns with a width of 0, to see the data. but thanks.

            X 1 Reply Last reply
            0
            • J jasper018

              Thank you for the help, but that does not work. You can see all the columns with a width of 0, they appear as just lines... you can still expand the columns with a width of 0, to see the data. but thanks.

              X Offline
              X Offline
              Xmen Real
              wrote on last edited by
              #6

              set "AllowUserToResizeColumns" property to false

              TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can

              1 Reply Last reply
              0
              • J jasper018

                Thank you for the help, but that does not work. You can see all the columns with a width of 0, they appear as just lines... but thanks.

                R Offline
                R Offline
                Ravenet
                wrote on last edited by
                #7

                Hi Is it in web or windows applciations? thanks

                Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

                J 1 Reply Last reply
                0
                • R Ravenet

                  Hi Is it in web or windows applciations? thanks

                  Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

                  J Offline
                  J Offline
                  jasper018
                  wrote on last edited by
                  #8

                  this is in a win app

                  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