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. Hide a column datagrid in windows application

Hide a column datagrid in windows application

Scheduled Pinned Locked Moved C#
question
6 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.
  • T Offline
    T Offline
    Test270307
    wrote on last edited by
    #1

    Hi friends, how can i hide a column from a datagrid.suppose i use a store procedure having eight columns. i want to hide the primary key column.how can i do that. remember it is a windows application not web. thanks

    N F A N 4 Replies Last reply
    0
    • T Test270307

      Hi friends, how can i hide a column from a datagrid.suppose i use a store procedure having eight columns. i want to hide the primary key column.how can i do that. remember it is a windows application not web. thanks

      N Offline
      N Offline
      Nouman Bhatti
      wrote on last edited by
      #2

      if u only want to display data. then u should try using listview control by using that u can easily hide/show the required columns.

      1 Reply Last reply
      0
      • T Test270307

        Hi friends, how can i hide a column from a datagrid.suppose i use a store procedure having eight columns. i want to hide the primary key column.how can i do that. remember it is a windows application not web. thanks

        F Offline
        F Offline
        freshonlineMax
        wrote on last edited by
        #3

        Hi Use below code : dataGridView1.Columns[0].Visible=false; I can help you in other fields about DataGridView "freshonline2003@yahoo.com" Bye

        T 1 Reply Last reply
        0
        • T Test270307

          Hi friends, how can i hide a column from a datagrid.suppose i use a store procedure having eight columns. i want to hide the primary key column.how can i do that. remember it is a windows application not web. thanks

          A Offline
          A Offline
          Abdul Sami X
          wrote on last edited by
          #4

          define a dataset, a datatable, map all the columns of the datatable while mapping, use mapping type as hidden for the column which you want to hide.

          Sr. Software Engineer Irevna, India

          1 Reply Last reply
          0
          • F freshonlineMax

            Hi Use below code : dataGridView1.Columns[0].Visible=false; I can help you in other fields about DataGridView "freshonline2003@yahoo.com" Bye

            T Offline
            T Offline
            Test270307
            wrote on last edited by
            #5

            i am saying about datagrid..not datagridview.

            1 Reply Last reply
            0
            • T Test270307

              Hi friends, how can i hide a column from a datagrid.suppose i use a store procedure having eight columns. i want to hide the primary key column.how can i do that. remember it is a windows application not web. thanks

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              Test270307 wrote:

              i use a store procedure having eight columns. i want to hide the primary key column.how can i do that.

              In the stored procedure avoid selecting the column that you don't want to display


              printf("Navaneeth!!") www.w3hearts.com

              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