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. Database & SysAdmin
  3. Database
  4. Display few columns in datagridview.

Display few columns in datagridview.

Scheduled Pinned Locked Moved Database
tutorialquestioncareer
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.
  • J Offline
    J Offline
    jeshra279
    wrote on last edited by
    #1

    Hi everyone, I have a table with 4 columns = "Name", "Age", "Place","Salary". I want to display only "Name" and "Age" column with entries in Datagridview in my Form. Cany anyone please tell me how to do this?

    D S 2 Replies Last reply
    0
    • J jeshra279

      Hi everyone, I have a table with 4 columns = "Name", "Age", "Place","Salary". I want to display only "Name" and "Age" column with entries in Datagridview in my Form. Cany anyone please tell me how to do this?

      D Offline
      D Offline
      Dave2909
      wrote on last edited by
      #2

      I'll assume you're using VB.NET or something similar... If you don't want to show certain columns, simply don't show them. This may entail turning off auto-generate columns in your grid and adding in your own custom column definitions (lots of examples of grids can be found on Google.) The other alternative is to make your datasource come from a query or view rather than grabbing the whole table. -Dave

      1 Reply Last reply
      0
      • J jeshra279

        Hi everyone, I have a table with 4 columns = "Name", "Age", "Place","Salary". I want to display only "Name" and "Age" column with entries in Datagridview in my Form. Cany anyone please tell me how to do this?

        S Offline
        S Offline
        Syed Shahid Hussain
        wrote on last edited by
        #3

        simple just do it gv.Cloumns["YourColumnsName4hide"].Visible = False that's it

        Syed Shahid Hussain

        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