gridview custom no. column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • questionit
    Contributor
    • Feb 2007
    • 553

    #1

    gridview custom no. column

    Hi

    New to vb.net

    I create a GridView. It has default three columsn. cant find the way to delete a colmn, i want only 1 column in it

    how to do this from design view?

    thanks
    qi
  • yarbrough40
    Contributor
    • Jun 2009
    • 320

    #2
    sounds like your using visual studio or web developer - are you?
    how are you planning to feed the data into the grid (filling a dataset w code vs. creating a connection object)?

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Your GridView or DataGridView's columns are automatically added for you based on the DataSource that it's bound to.

      When you bind the GrdiView or DataGridView to a data source, the data source's properties (if it's an Object) or columns (if it's a table) become the columns displayed for the GridView or DataGridView.

      If you don't want certain columns to be displayed you have a couple of options.

      The first one would be to modify the data source so that it only contains the columns/properties that you want displayed.

      The second would be to modify the GridView or DataGridView itself. But before I can recommend how to do this I need to know, are you using an ASP.NET GridView or are you developing a desktop application and you're using the DataGridView?

      -Frinny

      Comment

      Working...